Skip to content

Commit

Permalink
Made service more structured
Browse files Browse the repository at this point in the history
  • Loading branch information
ncthbrt committed Jan 23, 2018
1 parent 462b225 commit cc8f043
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/monitoring/console-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const logToConsole = ({ consoleProxy, formatter, name } = {}) => {
channels[LogLevel.CRITICAL] = proxy.critical || channels[LogLevel.ERROR];

const actorRefToString = (actor) => new ActorPath(actor.path.parts, actor.path.system).toString();
const formatTrace = formatter || ((logEvent) => `[${logLevelToString(logEvent.level)}] ${actorRefToString(logEvent.actor)} - ${logEvent.message}`);
const formatMetrics = formatter || ((logEvent) => `[METRIC] ${actorRefToString(logEvent.actor)} - ${logEvent.message}`);
const formatEvent = formatter || ((logEvent) => `[EVENT] ${actorRefToString(logEvent.actor)} - ${logEvent.message}`);
const formatException = formatter || ((logEvent) => `[EXCEPTION] ${actorRefToString(logEvent.actor)} - ${logEvent.message}`);
const formatTrace = formatter || ((logTrace) => `[${logLevelToString(logTrace.level)} @ ${logTrace.createdAt}] ${actorRefToString(logTrace.actor)} - ${logTrace.message}`);
const formatMetrics = formatter || ((logMetric) => `[METRIC @ ${logMetric.createdAt}] ${actorRefToString(logMetric.actor)} - ${logMetric.name}: ${JSON.stringify(logMetric.values, undefined, 4)}`);
const formatEvent = formatter || ((logEvent) => `[EVENT @ ${logEvent.createdAt}] ${actorRefToString(logEvent.actor)} - ${logEvent.name}: ${JSON.stringify(logEvent.properties, undefined, 4)}`);
const formatException = formatter || ((logException) => `[EXCEPTION @ ${logException.createdAt}] ${actorRefToString(logException.actor)} - ${logException.exception}`);

const getChannel = (level) => {
const possibleChannel = channels[level];
Expand Down

0 comments on commit cc8f043

Please sign in to comment.