Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TODO] Implementation of Logger #67

Open
Bratah123 opened this issue Mar 7, 2023 · 1 comment
Open

[TODO] Implementation of Logger #67

Bratah123 opened this issue Mar 7, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Bratah123
Copy link
Member

Bratah123 commented Mar 7, 2023

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.

@Bratah123 Bratah123 added the enhancement New feature or request label Mar 7, 2023
@KOOKIIEStudios
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants