fix(build): migrate project config to .smartconfig.json and replace smartfile usage with native fs
This commit is contained in:
@@ -26,7 +26,7 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
|
||||
|
||||
public uniInstanceId: string = plugins.isounique.uni();
|
||||
|
||||
private consoleEnabled: boolean;
|
||||
private consoleEnabled: boolean = false;
|
||||
|
||||
private logRouter = new LogRouter();
|
||||
|
||||
@@ -52,11 +52,11 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
|
||||
const originalStdoutWrite = process.stdout.write.bind(process.stdout);
|
||||
const originalStderrWrite = process.stderr.write.bind(process.stderr);
|
||||
|
||||
process.stdout.write = (...args: any) => {
|
||||
process.stdout.write = ((...args: any[]) => {
|
||||
const logString: string = args[0];
|
||||
if (!logString || typeof logString !== 'string') {
|
||||
// continue as planned
|
||||
return originalStdoutWrite(...args);
|
||||
return (originalStdoutWrite as any)(...args);
|
||||
}
|
||||
|
||||
if (!logString.startsWith('LOG')) {
|
||||
@@ -68,17 +68,17 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
|
||||
return true;
|
||||
}
|
||||
|
||||
return originalStdoutWrite(...args);
|
||||
};
|
||||
return (originalStdoutWrite as any)(...args);
|
||||
}) as typeof process.stdout.write;
|
||||
|
||||
process.stderr.write = (...args: any) => {
|
||||
process.stderr.write = ((...args: any[]) => {
|
||||
const logString: string = args[0];
|
||||
if (!logString || typeof logString !== 'string' || !logString.startsWith('LOG')) {
|
||||
this.log('error', logString);
|
||||
return true;
|
||||
}
|
||||
return originalStderrWrite(...args);
|
||||
};
|
||||
return (originalStderrWrite as any)(...args);
|
||||
}) as typeof process.stderr.write;
|
||||
}
|
||||
this.consoleEnabled = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user