fix(ci): Update CI workflows, build scripts, and export configuration
This commit is contained in:
8
ts_destination_devtools/00_commitinfo_data.ts
Normal file
8
ts_destination_devtools/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @push.rocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartlog-destination-devtools',
|
||||
version: '1.0.12',
|
||||
description: 'A library enabling enhanced logging in browser development tools.'
|
||||
}
|
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;
|
||||
}
|
||||
}
|
||||
}
|
2
ts_destination_devtools/plugins.ts
Normal file
2
ts_destination_devtools/plugins.ts
Normal file
@ -0,0 +1,2 @@
|
||||
import * as smartlogInterfaces from '../dist_ts_interfaces/index.js';
|
||||
export { smartlogInterfaces };
|
Reference in New Issue
Block a user