Skip to content

Commit

Permalink
Use same log format cli uses for cli messages
Browse files Browse the repository at this point in the history
  • Loading branch information
cdupuis committed Aug 21, 2018
1 parent 7dfebe7 commit b936373
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/internal/util/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function addFileTransport(filename: string, level: string) {

export function formatter(options: any): string {
if (LoggingConfig.format === "cli") {
return options.message;
return `atomist: [${options.level.toUpperCase()}] ${options.message}`;
}

const executionContext = context.get();
Expand Down Expand Up @@ -76,8 +76,8 @@ export function formatter(options: any): string {
}
}

const level = options.colorize ? winston.config.colorize(options.level, _.padEnd(options.level, 5)) :
_.padEnd(options.level, 5);
const level = options.colorize ? winston.config.colorize(options.level, _.padEnd(options.level.toUpperCase(), 5)) :
_.padEnd(options.level.toUpperCase(), 5);

const formatted = (options.timestamp ? new Date().toISOString() : "") + (ctx ? " [" + ctx + "]" : "")
+ " [" + level + "] " + (options.message ? options.message : "") +
Expand Down

0 comments on commit b936373

Please sign in to comment.