Upgraded dependencies, bumped to Node 24.
This commit is contained in:
+8
-5
@@ -1,13 +1,13 @@
|
||||
import util from 'util';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import util from 'node:util';
|
||||
import stackParser from 'error-stack-parser';
|
||||
import * as winston from 'winston';
|
||||
import 'winston-daily-rotate-file';
|
||||
import stackParser from 'error-stack-parser';
|
||||
|
||||
// import args from './args';
|
||||
|
||||
export default function initLogger(customLabel) {
|
||||
const filepath = stackParser.parse(new Error())[1]?.fileName;
|
||||
const filepath = stackParser.parse(new Error('stack'))[1]?.fileName;
|
||||
const contextLabel = customLabel || path.basename(filepath, '.js');
|
||||
|
||||
return winston.createLogger({
|
||||
@@ -18,7 +18,10 @@ export default function initLogger(customLabel) {
|
||||
: { ...info, message: typeof info.message === 'string' ? info.message : util.inspect(info.message) }))(),
|
||||
winston.format.colorize(),
|
||||
winston.format.printf(({
|
||||
level, timestamp, label, message,
|
||||
level,
|
||||
timestamp,
|
||||
label,
|
||||
message,
|
||||
}) => `${timestamp} ${level} [${label || contextLabel}] ${message}`),
|
||||
),
|
||||
transports: [
|
||||
|
||||
Reference in New Issue
Block a user