Merge pull request #5269 from antobinary/log-node-version

Log nodejs version for debugging purposes.  Resolve "CLIENT LOG: [object Object]"
This commit is contained in:
Anton Georgiev 2018-03-21 16:07:05 -04:00 committed by GitHub
commit f1cfc7a49f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -1,7 +1,11 @@
import Logger from '/imports/startup/server/logger';
const logClient = (type, log, ...args) => {
Logger.log(type, `CLIENT LOG: ${log}\n`, ...args);
if (typeof log === 'string' || log instanceof String) {
Logger.log(type, `CLIENT LOG: ${log}\n`, ...args);
} else {
Logger.log(type, `CLIENT LOG: ${JSON.stringify(log)}\n`, ...args);
}
};
export default logClient;

View File

@ -6,7 +6,8 @@ import Redis from './redis';
Meteor.startup(() => {
const APP_CONFIG = Meteor.settings.public.app;
Logger.info(`SERVER STARTED. DEV_ENV=${Meteor.isDevelopment} PROD_ENV=${Meteor.isProduction}`, APP_CONFIG);
const env = Meteor.isDevelopment ? 'development' : 'production';
Logger.warn(`SERVER STARTED. ENV=${env}, nodejs version=${process.version}`, APP_CONFIG);
});
WebApp.connectHandlers.use('/check', (req, res) => {