Path fixes for all environments, npm run format, removed redundant imports

This commit is contained in:
2024-10-01 00:10:30 +02:00
parent 4cbd62cbb0
commit ce1708a55e
24 changed files with 82 additions and 87 deletions

View File

@ -1,6 +1,6 @@
import pino from 'pino'
import fs from 'fs'
import path from 'path'
import { getRootPath } from './utilities'
// Array of log types
const LOG_TYPES = ['http', 'game', 'gameMaster', 'app', 'queue', 'command'] as const
@ -30,7 +30,7 @@ const loggers = Object.fromEntries(LOG_TYPES.map((type) => [type, createLogger(t
const watchLogs = () => {
LOG_TYPES.forEach((type) => {
const logFile = path.join(__dirname, '../../logs', `${type}.log`)
const logFile = getRootPath('logs', `${type}.log`)
fs.watchFile(logFile, (curr, prev) => {
if (curr.size > prev.size) {