BREAKING CHANGE(core): switch to esm

This commit is contained in:
2022-06-26 10:35:35 +02:00
parent d5d6d7bf79
commit 964666902f
14 changed files with 4602 additions and 18462 deletions

View File

@ -1,7 +1,7 @@
import * as plugins from './smartlog.plugins';
import * as plugins from './smartlog.plugins.js';
import { LogRouter } from './smartlog.classes.logrouter';
import { LogGroup } from '.';
import { LogRouter } from './smartlog.classes.logrouter.js';
import { LogGroup } from './smartlog.classes.loggroup.js';
export interface ISmartlogContructorOptions {
logContext: plugins.smartlogInterfaces.ILogContext;
@ -24,7 +24,7 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
constructor(optionsArg: ISmartlogContructorOptions) {
this.logContext = optionsArg.logContext;
this.minimumLogLevel = optionsArg.minimumLogLevel;
this.minimumLogLevel = optionsArg.minimumLogLevel || 'silly';
}
// ============
@ -50,7 +50,7 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
default:
this.log('info', logString);
}
return;
return true;
}
// fileStream.write(args[0]);
write.apply(process.stdout, args);
@ -60,7 +60,7 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
process.stderr.write = (...args: any) => {
if (!args[0].startsWith('LOG')) {
this.log('error', args[0]);
return;
return true;
}
// fileStream.write(args[0]);
write.apply(process.stderr, args);