@fulfilld/app-logging
Usage
// execute once in your application entrypoint
initDebugGlobals({
application: '[friendly app name]'
});
// retrive a logger identified by the options provided
const logger = getLogger({
module: 'Auth',
component: 'User Authentication',
class: 'UserAuthController'
});
// write a log line
logger.debug('Received token from Oauth provider for user ${username}');
// log an error object
try {} catch (err) {
logger.error(err);
}
Examples
# execute in a shell
ENVIRONMENT=local npx ts-node src/examples/app-test.ts
Environment Variables
#Enable console log output
DEBUG_LOGGING=true | false