fix(ci): Update CI workflows, build scripts, and export configuration
This commit is contained in:
58
ts_destination_devtools/index.ts
Normal file
58
ts_destination_devtools/index.ts
Normal file
@ -0,0 +1,58 @@
|
||||
import * as plugins from './plugins.js';
|
||||
import type { ILogDestination, ILogPackage } from '../dist_ts_interfaces/index.js';
|
||||
|
||||
export class SmartlogDestinationDevtools implements ILogDestination {
|
||||
public async handleLog(logPackageArg: ILogPackage) {
|
||||
await this.logInBrowser(logPackageArg);
|
||||
}
|
||||
|
||||
private async logInBrowser(logPackage: ILogPackage) {
|
||||
switch (logPackage.level) {
|
||||
case 'error':
|
||||
console.log(
|
||||
`%c Error: %c ${logPackage.message}`,
|
||||
'background:#000000;color:#800000;',
|
||||
'color:#000000;'
|
||||
);
|
||||
break;
|
||||
case 'info':
|
||||
console.log(
|
||||
`%c Info: %c ${logPackage.message}`,
|
||||
'background:#EC407A;color:#ffffff;',
|
||||
'color:#EC407A;'
|
||||
);
|
||||
break;
|
||||
case 'ok':
|
||||
console.log(
|
||||
`%c OK: %c ${logPackage.message}`,
|
||||
'background:#000000;color:#8BC34A;',
|
||||
'color:#000000;'
|
||||
);
|
||||
break;
|
||||
case 'success':
|
||||
console.log(
|
||||
`%c Success: %c ${logPackage.message}`,
|
||||
'background:#8BC34A;color:#ffffff;',
|
||||
'color:#8BC34A;'
|
||||
);
|
||||
break;
|
||||
case 'warn':
|
||||
console.log(
|
||||
`%c Warn: %c ${logPackage.message}`,
|
||||
'background:#000000;color:#FB8C00;',
|
||||
'color:#000000;'
|
||||
);
|
||||
break;
|
||||
case 'note':
|
||||
console.log(
|
||||
`%c Note: %c ${logPackage.message}`,
|
||||
'background:#42A5F5;color:#ffffff',
|
||||
'color:#42A5F5;'
|
||||
);
|
||||
break;
|
||||
default:
|
||||
console.log(`unknown logType for "${logPackage.message}"`);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user