BAA-Studios/MOOgiwara

[TODO] Implementation of Logger

Opened this issue · 1 comments

Abstract

Currently, the server is using console.log to print out debug lines for the server which is fine for a localhost environment.
Once the server is logging hundreds of user inputs, consider using a logging library.

Details

@KOOKIIEStudios suggested: moving to a logger library like winston.

Abstract

Commit c0109bf: Implemented a rotating + console logger.
Log files can be found in MOOgiwara/server/logs, and rotate on a daily basis.
Old log files are zipped and subsequently deleted after 14 days.
To convert existing log lines over in future commits.

How to use

import logger from './util/logger';

logger.debug('test');

Logger Levels

Winston uses the same logging levels as npm:

Method Level
error 0
warn 1
info 2
http 3
verbose 4
debug 5
silly 6