fix(build): migrate project config to .smartconfig.json and replace smartfile usage with native fs

This commit is contained in:
2026-04-07 15:58:41 +00:00
parent d2f38be0af
commit 54caa7ae8c
15 changed files with 2050 additions and 3311 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartlog',
version: '3.2.1',
version: '3.2.2',
description: 'A minimalistic, distributed, and extensible logging tool supporting centralized log management.'
}

View File

@@ -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;
}