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

Commit

Permalink
add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
yacut committed Dec 12, 2019
1 parent 8f2beef commit 18f299f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class GrafanaSync {
.filter((m) => m.role && m.role === role)
.map((m) => m.email);
} catch (e) {
this.logger.error({ orgId, error: this.formatError(e) });
this.logger.error("Failed to get grafana users", { orgId, error: this.formatError(e) });
}
}

Expand All @@ -217,7 +217,7 @@ class GrafanaSync {
}
return response.id;
} catch (e) {
this.logger.error({ email, error: this.formatError(e) });
this.logger.error("Failed to get grafana user by email", { email, error: this.formatError(e) });
}
}

Expand All @@ -243,7 +243,7 @@ class GrafanaSync {
this.logger.debug({ userId, email, role }, "Got grafana user role.");
return role;
} catch (e) {
this.logger.error({ userId, error: this.formatError(e) });
this.logger.error("Failed to get grafana user role", { userId, error: this.formatError(e) });
}
}

Expand All @@ -267,7 +267,7 @@ class GrafanaSync {
this.logger.debug({ orgId, email, role, response }, "Created grafana organisation user.");
return response;
} catch (e) {
this.logger.debug({ orgId, email, role, error: this.formatError(e) });
this.logger.error("Failed to create grafana user", { orgId, email, role, error: this.formatError(e) });
}
}

Expand All @@ -289,7 +289,7 @@ class GrafanaSync {
this.logger.debug({ orgId, userId, role, response }, "Updated grafana user.");
return response;
} catch (e) {
this.logger.error({ orgId, userId, role, error: this.formatError(e) });
this.logger.error("Failed to update grafana user", { orgId, userId, role, error: this.formatError(e) });
}
}

Expand All @@ -312,7 +312,7 @@ class GrafanaSync {
this.logger.debug({ orgId, userId, response }, "Delete grafana user.");
return response;
} catch (e) {
this.logger.error({ orgId, userId, error: this.formatError(e) });
this.logger.error("Failed to dalete grafana user", { orgId, userId, error: this.formatError(e) });
}
}

Expand Down Expand Up @@ -363,7 +363,7 @@ class GrafanaSync {

} catch (e) {
self.fail.inc();
self.logger.error(self.formatError(e));
self.logger.error("Failed to build grafana and google users cache", self.formatError(e));
}
}));

Expand All @@ -387,7 +387,7 @@ class GrafanaSync {
}
}
} catch (e) {
self.logger.error(self.formatError(e));
self.logger.error("Failed to create or update all google users in grafana", self.formatError(e));
} finally {
self.logger.debug(`Remove user ${email} from sync map.`);
self.grafanaMembers.set(uniqueId, self.grafanaMembers.get(uniqueId).filter((e) => e !== email));
Expand Down Expand Up @@ -439,7 +439,7 @@ class GrafanaSync {
}
}
} catch (e) {
self.logger.error(self.formatError(e));
self.logger.error("Failed to create or update static users", self.formatError(e));
} finally {
if (self.grafanaMembers.get(uniqueId)) {
self.logger.debug(`Remove user ${email} from sync map.`);
Expand Down

0 comments on commit 18f299f

Please sign in to comment.