2023/02/07
The triple-beam types package has been promoted to a full dependency, by first-time contributor @carboneater (Thanks!) in https://github.com/winstonjs/logform/pull/243 to fix https://github.com/winstonjs/logform/issues/242.
2023/02/06
All the improvements in this release are from first-time contributors - thanks for your contributions!
2022/07/05
This patch-level release includes a fix for a crash on attempt to uncolorize Symbol. Thanks to @Alexsey for that first contribution in https://github.com/winstonjs/logform/pull/188.
Line break styles were changed to be LF (instead of CRLF) more consistently so that linter warnings aren't drowned out by notes about that.
2022/06/21
2022/02/12
CliFormat
(this was likely a typo originally)safe-stable-stringify
2.x options as parameters in JsonOptions
2022/01/09
This update, which also used up version number 2.3.1, pinned the version of the colors
dependency
due to vandalism by a developer of that package, as noted here.
As discussed in the winston
package, all users should update to this (or a later version, should one exist) ASAP.
2021/09/21
2020/06/21
2019/01/31
2019/01/29
2019/01/07
{ all: true }
is set, colorize the entire serialized message.2018/12/23
splat
behavior` below.README.md
splat
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
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
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