GitXplorerGitXplorer
k

mlogy

public
0 stars
0 forks
1 issues

Commits

List of commits on branch master.
Unverified
087b6596f280a9116492a3818fb40c4220de4326

explicitly state files to include in package

kkeis committed 9 years ago
Unverified
20f606e31a80cf6ee2b6d90a0ff06b2d7712dc7d

add more nodejs versions to test

kkeis committed 9 years ago
Unverified
4dabc641562d14325bcee9e6a52f393f319247dc

log-record@^1.0.1

kkeis committed 9 years ago
Unverified
ecaea5f1b2437f04b543f38f2cdcf03ea2064245

update dev dependencies

kkeis committed 9 years ago
Unverified
fe74f747758a1fef6ea2de49de6aeea90d0f4730

object-assign@^4.0.0

kkeis committed 9 years ago
Unverified
8dece9fccf9c19c458e109a87ec69874c20a7b07

1.0.2

kkeis committed 9 years ago

README

The README file for this repository.

mlogy

NPM Version Build Status Coverage Status

Interface for creating log records

Installation

npm install --save mlogy

Usage

The modules assumes loggers are organized in a tree tracked by the parent attribute however this is managed outside the implementation of the logger.

Logger(context, name, [level])

  • context

    The context contains the shared settings shared between all loggers in a system. The context is stored as context on the logger and is allowed to change during the life time of the logger to allow loggers created by libraries to be assimilated into a bigger application logger hierarchy

    • defaultProcessors

      A List of processors; functions that accepts a record and somehow modifies it by e.g attaching extra data

    • proxy

      A proxy through which all records should be sent.

  • name

    The name of the logger. By convention a dot.separated.string

  • level

    The minimum level the logger will process records for as either a numeric value or a named level from standard-levels. If undefined the level of the parent logger is used.

var Logger = require('mlogy')
  , ctx = {defaultProcessors: []}
  , root = new Logger(ctx, '', 'ERROR')
  , other = new Logger(ctx, 'other', 'DEBUG')

other.parent = root

setLevel

Update the minimum level the logger will process records for

trace(frmt, ...)

debug(frmt, ...)

info(frmt, ...)

warn(frmt, ...)

error(frmt, ...)

critical(frmt, ...)

Send a message at the indicated level