npm.io
0.2.5 • Published 7 years ago

@machinomy/logger

Licence
Apache-2.0
Version
0.2.5
Deps
3
Size
12 kB
Vulns
0
Weekly
0
Stars
166

Machinomy Logger

Machinomy logger. Works in browser and Node.

Basic usage

import Logger from '@machinomy/logger'

const LOG = new Logger('your-namespace')

LOG.info('This is info message')
LOG.warn('This is warn message')
LOG.error('This is error message')
LOG.fatal('This is fatal message')
LOG.debug('This is debug message')
LOG.trace('This is trace message')

Usage with LogDNA

import Logger from '@machinomy/logger'

const LOG = new Logger(
    'your-namespace',
    'LogDNA-Ingestion-Key-As-String',    // Ingestion Key from "API Keys" section of LogDNA website
    { hostname: 'another-host' }         // Any LogDNA for Node.js constructor options
 )

LOG.info('This is info message')
LOG.warn('This is warn message')
LOG.error('This is error message')
LOG.fatal('This is fatal message')
LOG.debug('This is debug message')
LOG.trace('This is trace message')

For more LogDNA options see LogDNA for Node.js

DO NOT FORGET TO DEFINE "DEBUG=*" ENV VARIABLE!

IF YOU USE @machinomy/logger AT MULTIPLE LAYERS OF YOUR SOFTWARE - DO NOT FORGET TO DEFINE "DEBUG_DEPTH=10" ENV VARIABLE!

Web site: machinomy.com. Twitter: @machinomy. Support/Discussion: Gitter.

Please, pay attention, this package is the part of Machinomy Lerna Monorepo and it's intended to use with other monorepo's packages.

You should not git clone this repository alone

You should git clone the main repository via

git clone https://github.com/machinomy/machinomy.git
or 
git clone git@github.com:machinomy/machinomy.git

For documentation, usage and contributing please see Machinomy Monorepo.