Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
...(process.env.DEBUG && process.env.NODE_ENV !== 'production'
? [
{
type: 'raw',
stream: new ConsoleRawStream(),
closeOnExit: false,
level: 'debug',
},
]
: []),
],
});
logger.notifications = logger.child({ type: 'notifications' });
logger.global = logger.child({ type: 'global' });
logger.DEBUG = bunyan.DEBUG;
logger.INFO = bunyan.INFO;
logger.WARN = bunyan.WARN;
logger.ERROR = bunyan.ERROR;
export default logger;
stream: new ConsoleRawStream(),
closeOnExit: false,
level: 'debug',
},
]
: [],
});
export type LogStream = bunyan.Stream;
export type Log = bunyan;
export default {
child: (options: object) => logger.child(options),
notifications: logger.child({ type: 'notifications' }),
global: logger.child({ type: 'global' }),
DEBUG: bunyan.DEBUG,
INFO: bunyan.INFO,
WARN: bunyan.WARN,
ERROR: bunyan.ERROR,
};
color: StyleConstants.colorError,
},
logLeftMsg: {
fontSize: StyleConstants.fontSizeSm,
color: StyleConstants.colorSubtitle,
width: 85,
minWidth: 85,
},
loadingIndicator: {
paddingLeft: StyleConstants.gutterLg,
paddingTop: StyleConstants.gutterLg,
},
};
const LOG_LEVEL_TO_STYLE = {
[bunyan.DEBUG]: InlineStyles.logDebug,
[bunyan.INFO]: InlineStyles.logDefault,
[bunyan.WARN]: InlineStyles.logWarning,
[bunyan.ERROR]: InlineStyles.logError,
};