Skip to content
This repository was archived by the owner on Feb 4, 2020. It is now read-only.

Commit 18f299f

Browse files
author
yacut
committed
add more logs
1 parent 8f2beef commit 18f299f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

index.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class GrafanaSync {
196196
.filter((m) => m.role && m.role === role)
197197
.map((m) => m.email);
198198
} catch (e) {
199-
this.logger.error({ orgId, error: this.formatError(e) });
199+
this.logger.error("Failed to get grafana users", { orgId, error: this.formatError(e) });
200200
}
201201
}
202202

@@ -217,7 +217,7 @@ class GrafanaSync {
217217
}
218218
return response.id;
219219
} catch (e) {
220-
this.logger.error({ email, error: this.formatError(e) });
220+
this.logger.error("Failed to get grafana user by email", { email, error: this.formatError(e) });
221221
}
222222
}
223223

@@ -243,7 +243,7 @@ class GrafanaSync {
243243
this.logger.debug({ userId, email, role }, "Got grafana user role.");
244244
return role;
245245
} catch (e) {
246-
this.logger.error({ userId, error: this.formatError(e) });
246+
this.logger.error("Failed to get grafana user role", { userId, error: this.formatError(e) });
247247
}
248248
}
249249

@@ -267,7 +267,7 @@ class GrafanaSync {
267267
this.logger.debug({ orgId, email, role, response }, "Created grafana organisation user.");
268268
return response;
269269
} catch (e) {
270-
this.logger.debug({ orgId, email, role, error: this.formatError(e) });
270+
this.logger.error("Failed to create grafana user", { orgId, email, role, error: this.formatError(e) });
271271
}
272272
}
273273

@@ -289,7 +289,7 @@ class GrafanaSync {
289289
this.logger.debug({ orgId, userId, role, response }, "Updated grafana user.");
290290
return response;
291291
} catch (e) {
292-
this.logger.error({ orgId, userId, role, error: this.formatError(e) });
292+
this.logger.error("Failed to update grafana user", { orgId, userId, role, error: this.formatError(e) });
293293
}
294294
}
295295

@@ -312,7 +312,7 @@ class GrafanaSync {
312312
this.logger.debug({ orgId, userId, response }, "Delete grafana user.");
313313
return response;
314314
} catch (e) {
315-
this.logger.error({ orgId, userId, error: this.formatError(e) });
315+
this.logger.error("Failed to dalete grafana user", { orgId, userId, error: this.formatError(e) });
316316
}
317317
}
318318

@@ -363,7 +363,7 @@ class GrafanaSync {
363363

364364
} catch (e) {
365365
self.fail.inc();
366-
self.logger.error(self.formatError(e));
366+
self.logger.error("Failed to build grafana and google users cache", self.formatError(e));
367367
}
368368
}));
369369

@@ -387,7 +387,7 @@ class GrafanaSync {
387387
}
388388
}
389389
} catch (e) {
390-
self.logger.error(self.formatError(e));
390+
self.logger.error("Failed to create or update all google users in grafana", self.formatError(e));
391391
} finally {
392392
self.logger.debug(`Remove user ${email} from sync map.`);
393393
self.grafanaMembers.set(uniqueId, self.grafanaMembers.get(uniqueId).filter((e) => e !== email));
@@ -439,7 +439,7 @@ class GrafanaSync {
439439
}
440440
}
441441
} catch (e) {
442-
self.logger.error(self.formatError(e));
442+
self.logger.error("Failed to create or update static users", self.formatError(e));
443443
} finally {
444444
if (self.grafanaMembers.get(uniqueId)) {
445445
self.logger.debug(`Remove user ${email} from sync map.`);

0 commit comments

Comments
 (0)