mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-30 09:47:50 +01:00
fix logger reference error
This commit is contained in:
@@ -3,6 +3,8 @@ smoothly when you don't have a deck, or when you and your friends are together v
|
||||
<a href="https://boardgamegeek.com/boardgame/152242/ultimate-werewolf-deluxe-edition">Ultimate Werewolf</a> and by
|
||||
2020's quarantine. The app is free to use and anonymous.
|
||||
|
||||

|
||||
|
||||
## Features
|
||||
|
||||
This is meant to facilitate a game through a shared game state and various utilities - not to control
|
||||
|
||||
BIN
client/src/images/screenshots/moderator.PNG
Normal file
BIN
client/src/images/screenshots/moderator.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 84 KiB |
BIN
client/src/images/screenshots/player.PNG
Normal file
BIN
client/src/images/screenshots/player.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
@@ -14,7 +14,7 @@ app.use(bodyParser.urlencoded({
|
||||
const args = ServerBootstrapper.processCLIArgs();
|
||||
|
||||
const logger = require('./modules/Logger')(args.logLevel);
|
||||
logger.log('LOG LEVEL IS: ' + args.logLevel);
|
||||
logger.info('LOG LEVEL IS: ' + args.logLevel);
|
||||
|
||||
const main = ServerBootstrapper.createServerWithCorrectHTTPProtocol(app, args.useHttps, args.port, logger)
|
||||
|
||||
@@ -66,5 +66,5 @@ app.use(function (req, res) {
|
||||
});
|
||||
|
||||
main.listen(args.port, function () {
|
||||
logger.log(`Starting server on port ${args.port}` );
|
||||
logger.info(`Starting server on port ${args.port}` );
|
||||
});
|
||||
|
||||
@@ -64,7 +64,7 @@ class ActiveGameRunner {
|
||||
class Singleton {
|
||||
constructor (logger) {
|
||||
if (!Singleton.instance) {
|
||||
logger.log('CREATING SINGLETON ACTIVE GAME RUNNER');
|
||||
logger.info('CREATING SINGLETON ACTIVE GAME RUNNER');
|
||||
Singleton.instance = new ActiveGameRunner(logger);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ function pruneStaleGames(activeGames, timerThreads, logger) {
|
||||
class Singleton {
|
||||
constructor (logger, environment) {
|
||||
if (!Singleton.instance) {
|
||||
logger.log('CREATING SINGLETON GAME MANAGER');
|
||||
logger.info('CREATING SINGLETON GAME MANAGER');
|
||||
Singleton.instance = new GameManager(logger, environment);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ const globals = require('../config/globals');
|
||||
module.exports = function (logLevel = globals.LOG_LEVEL.INFO) {
|
||||
return {
|
||||
logLevel: logLevel,
|
||||
log (message = '') {
|
||||
info (message = '') {
|
||||
const now = new Date();
|
||||
console.log('LOG ', now.toGMTString(), ': ', message);
|
||||
},
|
||||
|
||||
@@ -38,7 +38,7 @@ const ServerBootstrapper = {
|
||||
createServerWithCorrectHTTPProtocol: (app, useHttps, port, logger) => {
|
||||
let main;
|
||||
if (process.env.NODE_ENV.trim() === 'development') {
|
||||
logger.log('starting main in DEVELOPMENT mode.');
|
||||
logger.info('starting main in DEVELOPMENT mode.');
|
||||
if (
|
||||
useHttps
|
||||
&& fs.existsSync(path.join(__dirname, '../../client/certs/localhost-key.pem'))
|
||||
@@ -46,13 +46,13 @@ const ServerBootstrapper = {
|
||||
) {
|
||||
const key = fs.readFileSync(path.join(__dirname, '../../client/certs/localhost-key.pem'), 'utf-8');
|
||||
const cert = fs.readFileSync(path.join(__dirname, '../../client/certs/localhost.pem'), 'utf-8');
|
||||
logger.log('local certs detected. Using HTTPS.');
|
||||
logger.info('local certs detected. Using HTTPS.');
|
||||
main = https.createServer({ key, cert }, app);
|
||||
logger.log(`navigate to https://localhost:${port}`);
|
||||
logger.info(`navigate to https://localhost:${port}`);
|
||||
} else {
|
||||
logger.log('https not specified or no local certs detected. Certs should reside in /client/certs. Using HTTP.');
|
||||
logger.info('https not specified or no local certs detected. Certs should reside in /client/certs. Using HTTP.');
|
||||
main = http.createServer(app);
|
||||
logger.log(`navigate to http://localhost:${port}`);
|
||||
logger.info(`navigate to http://localhost:${port}`);
|
||||
}
|
||||
} else {
|
||||
logger.warn('starting main in PRODUCTION mode. This should not be used for local development.');
|
||||
|
||||
Reference in New Issue
Block a user