1.0.1 • Published 3 years ago
@railtownai/loglevel-railtownai v1.0.1
loglevel Railtownai Plugin
Installation
npm i @railtownai/loglevel-railtownaiConfiguration
logger-object- loglevel instance to be extendedoptions-object- used to add your railtown token
Example
const loglevelRailtown = require('@railtownai/loglevel-railtownai');
loglevelRailtown(logger, {
token: 'your_token_here',
});
//or use environment variable 'RAILTOWN_TOKEN' and call it without the token key
loglevelRailtown(logger);Manually Logging Errors with additional properties
Import loglevelLogger and use as follows:
try {
// code to try
} catch (error) {
const logError = {
err: error,
userId: '123456789',
projectId:'abcdefg'
};
loglevelLogger.error(logError);
}This will send log messages to railtownai.