Use winston

This commit is contained in:
Ibby Hadeed
2017-12-28 23:15:34 -05:00
parent a26457b30a
commit 1c35991548
8 changed files with 88 additions and 14 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ import * as ts from 'typescript';
import * as fs from 'fs-extra';
import * as path from 'path';
import { camelCase, clone } from 'lodash';
import { Logger } from '../logger';
export const ROOT = path.resolve(__dirname, '../../');
export const TS_CONFIG = clone(require(path.resolve(ROOT, 'tsconfig.json')));
@@ -57,7 +58,7 @@ export function getDecoratorArgs(decorator: any) {
break;
default:
console.log(prop.initializer);
Logger.error('Unexpected property value type: ', prop.initializer.kind);
throw 'Unexpected property value type << helpers.ts >>';
}
+3 -2
View File
@@ -1,4 +1,5 @@
import * as ts from 'typescript';
import { Logger } from '../../logger';
import { convertValueToLiteral, getDecorator, getDecoratorArgs, getDecoratorName, getMethodsForDecorator } from '../helpers';
export function transformMethod(method: ts.MethodDeclaration) {
@@ -15,8 +16,8 @@ export function transformMethod(method: ts.MethodDeclaration) {
)
]));
} catch (e) {
console.log('Error transforming method: ', (method.name as any).text);
console.log(e.message);
Logger.error('Error transforming method: ' + (method.name as any).text);
Logger.error(e.message);
}
}
+3 -2
View File
@@ -1,10 +1,11 @@
import * as ts from 'typescript';
import { Logger } from '../../logger';
import { convertValueToLiteral, getDecorator, getDecoratorArgs, getDecoratorName } from '../helpers';
import { transformMembers } from './members';
function transformClass(cls: any, ngcBuild?: boolean) {
console.time('~ transformClass: ' + cls.name.text);
Logger.profile((ngcBuild ? '[ngc]' : '[esm]') + 'transformClass: ' + cls.name.text);
const pluginStatics = [];
const dec: any = getDecorator(cls);
@@ -37,7 +38,7 @@ function transformClass(cls: any, ngcBuild?: boolean) {
]
);
console.timeEnd('~ transformClass: ' + cls.name.text);
Logger.profile((ngcBuild ? '[ngc]' : '[esm]') + 'transformClass' + cls.name.text);
return cls;
}