Repository URL to install this package:
|
Version:
3.0.0-1 ▾
|
2020/06/21
2019/01/31
util.inspect.
2019/01/29
2019/01/07
{ all: true } is set, colorize the entire serialized message.2018/12/23
splat behavior` below.README.mdsplat behaviorPreviously splat would have added a meta property for any additional
info[SPLAT] beyond the expected number of tokens.
As of logform@2.0.0, format.splat assumes additional splat paramters
(aka "metas") are objects and merges enumerable properties into the info.
e.g.
const { format } = require('logform'); const { splat } = format; const { MESSAGE, LEVEL, SPLAT } = require('triple-beam'); console.log( // Expects two tokens, but three splat parameters provided. splat().transform({ level: 'info', message: 'Let us %s for %j', [LEVEL]: 'info', [MESSAGE]: 'Let us %s for %j', [SPLAT]: ['objects', { label: 'sure' }, { thisIsMeta: 'wut' }] }) ); // logform@1.x behavior: // Added "meta" property. // // { level: 'info', // message: 'Let us objects for {"label":"sure"}', // meta: { thisIsMeta: 'wut' }, // [Symbol(level)]: 'info', // [Symbol(message)]: 'Let us %s for %j', // [Symbol(splat)]: [ 'objects', { label: 'sure' } ] } // logform@2.x behavior: // Enumerable properties assigned into `info`. // // { level: 'info', // message: 'Let us objects for {"label":"sure"}', // thisIsMeta: 'wut', // [Symbol(level)]: 'info', // [Symbol(message)]: 'Let us %s for %j', // [Symbol(splat)]: [ 'objects', { label: 'sure' } ] }
The reason for this change is to be consistent with how winston itself
handles meta objects in its variable-arity conventions.
BE ADVISED previous "metas" that were not objects will very likely lead to odd behavior. e.g.
const { format } = require('logform'); const { splat } = format; const { MESSAGE, LEVEL, SPLAT } = require('triple-beam'); console.log( // Expects two tokens, but three splat parameters provided. splat().transform({ level: 'info', message: 'Let us %s for %j', [LEVEL]: 'info', [MESSAGE]: 'Let us %s for %j', // !!NOTICE!! Additional parameters are a string and an Array [SPLAT]: ['objects', { label: 'sure' }, 'lol', ['ok', 'why']] }) ); // logform@1.x behavior: // Added "meta" property. // // { level: 'info', // message: 'Let us objects for {"label":"sure"}', // meta: ['lol', ['ok', 'why']], // [Symbol(level)]: 'info', // [Symbol(message)]: 'Let us %s for %j', // [Symbol(splat)]: [ 'objects', { label: 'sure' } ] } // logform@2.x behavior: Enumerable properties assigned into `info`. // **Strings and Arrays only have NUMERIC enumerable properties!** // // { '0': 'ok', // '1': 'why', // '2': 'l', // level: 'info', // message: 'Let us objects for {"label":"sure"}', // [Symbol(level)]: 'info', // [Symbol(message)]: 'Let us %s for %j', // [Symbol(splat)]: [ 'objects', { label: 'sure' } ] }
2018/09/17
2018/06/26
meta when non-zero additional SPLAT arguments are
provided. (Fixes winstonjs/winston#1358).2018/06/12
winston@2.x for padLevels. Create a correct Cli format with initial state. (Fixes [#36]).2018/06/11
fast-safe-stringify for perf and to support circular refs.2018/05/24
2018/04/25
dependencies and add node@10 to the travis build of the project.2018/04/22
webpack warnings..travis.yml.2018/04/19
2018/04/06
2018/03/23
2018/03/16
2017/12/05
date-fns with fecha (with test cases) [@ChrisAlderson].2017/10/01
info.splat in format.simple to avoid double inclusion.2017/09/30
info.raw to info[Symbol.for('message')].README.md except for full list of all built-in formats.{ align, cli, padLevels }.2017/09/29
common.log in winston@2.x and below.format.combine to remove inconsistency in behavior between format(fn0) and format(fn0, ...moreFns).README.md now covers all of the basics for logform.2017/09/26