Skip to content

Commit

Permalink
fix: app won't start
Browse files Browse the repository at this point in the history
  • Loading branch information
KotRikD committed Dec 8, 2023
1 parent e0310a9 commit c1cd4ec
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
3 changes: 2 additions & 1 deletion packages/tosu/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Websockify from 'koa-websocket';

import { config, updateConfig } from './config';
import { OVERLAYS_STATIC } from './constants/overlaysStatic';
import { wLogger } from './logger';
import { configureLogger, wLogger } from './logger';
import { InstanceManager } from './objects/instanceManager/instanceManager';
import { OsuInstance } from './objects/instanceManager/osuInstance';
import { sleep } from './utils/sleep';
Expand All @@ -18,6 +18,7 @@ interface CustomContext extends Koa.Context {

(async () => {
updateConfig();
configureLogger();

wLogger.info('Starting tosu');

Expand Down
31 changes: 16 additions & 15 deletions packages/tosu/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ const customFormat = printf(({ level, message, label, timestamp }) => {
return `${timestamp} [${label}] ${level}: ${message}`;
});

winston.configure({
level: config.debugLogging ? 'debug' : 'info',
transports: [
//
// - Write to all logs with specified level to console.
new transports.Console({
format: format.combine(
format.colorize(),
label({ label: 'tosu' }),
timestamp(),
customFormat
)
})
]
});
export const configureLogger = () =>
winston.configure({
level: config.debugLogging ? 'debug' : 'info',
transports: [
//
// - Write to all logs with specified level to console.
new transports.Console({
format: format.combine(
format.colorize(),
label({ label: 'tosu' }),
timestamp(),
customFormat
)
})
]
});

export const wLogger = winston;

0 comments on commit c1cd4ec

Please sign in to comment.