Skip to content

Commit

Permalink
feat(console): move to chalk
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveVanOpstal committed May 30, 2016
1 parent e999faa commit 0f2c28a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@angular/http": "^2.0.0-rc.1",
"@angular/router": "^2.0.0-rc.1",
"async": "1.5.2",
"colors": "1.1.2",
"chalk": "1.1.3",
"core-js": "2.3.0",
"d3": "3.5.17",
"dateformat": "1.0.12",
Expand Down
12 changes: 6 additions & 6 deletions src/server/console.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Colors from 'colors';
var chalk = require('chalk');
var dateFormat = require('dateformat');

import {tim} from '../app/misc/tim';
Expand All @@ -17,17 +17,17 @@ export class ColorConsole {
}

public debug(message?: any, ...optionalParams: any[]): void {
optionalParams.unshift(Colors.blue(this.format(message, 'DBG')));
optionalParams.unshift(chalk.blue(this.format(message, 'DBG')));
console.debug.apply(this, optionalParams);
}

public error(message?: any, ...optionalParams: any[]): void {
optionalParams.unshift(Colors.red(this.format(message, 'ERR')));
optionalParams.unshift(chalk.red(this.format(message, 'ERR')));
console.error.apply(this, optionalParams);
}

public info(message?: any, ...optionalParams: any[]): void {
optionalParams.unshift(Colors.green(this.format(message, 'INF')));
optionalParams.unshift(chalk.green(this.format(message, 'INF')));
console.info.apply(this, optionalParams);
}

Expand All @@ -37,12 +37,12 @@ export class ColorConsole {
}

public trace(message?: any, ...optionalParams: any[]): void {
optionalParams.unshift(Colors.magenta(this.format(message, 'TRC')));
optionalParams.unshift(chalk.magenta(this.format(message, 'TRC')));
console.trace.apply(this, optionalParams);
}

public warn(message?: any, ...optionalParams: any[]): void {
optionalParams.unshift(Colors.yellow(this.format(message, 'WRN')));
optionalParams.unshift(chalk.yellow(this.format(message, 'WRN')));
console.warn.apply(this, optionalParams);
}

Expand Down

0 comments on commit 0f2c28a

Please sign in to comment.