Kiev-js

Kiev-js is a wrapper logging library around LogLevel implementing Blacklane logging standards.
Setup instructions
Requirements
Installation
npm install @blacklane/kiev-js
Usage
import {Logger, LoggerConfig, LogLevel} from '@blacklane/kiev-js'
const environment = process.env.NODE_ENV || 'development'
let loggerConfiguration: LoggerConfig = {
application: 'application-name',
environment: environment,
initializedFields: { foo: 'foo', bar: 'bar' },
filterFields: ["password", "accessToken"]
}
logger = new Logger(loggerConfiguration)
logger.debug('Something happening here', { foo: 'bar' })
logger.warn('WARN! Look at this', { foo: 'bar', password: "Hard_One" })
logger.setLevel(LogLevel.DEBUG)
logger.debug('FooBar', { fizz: 'buzz' })
const newLogger = logger.extend({ tracking_id: "an tracking ID" })
newLogger.info('GET / - 200 OK')
Contributing
- Pull the code:
git clone git@github.com:blacklane/kiev-js.git
- Install dependencies
npm install
- Run tests:
npm test
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Tests & Linter
- Run unit tests:
npm run test
- Run tests watch & coverage:
npm run test:cov
- Run Linter:
npm run lint