mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-05-20 00:06:24 +08:00
Use winston
This commit is contained in:
@@ -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 >>';
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user