This is a stub types definition for winston (https://github.com/winstonjs/winston.git).
winston provides its own type definitions, so you don't need @types/winston installed!
This is a stub types definition. winston provides its own type definitions, so you do not need this installed.
Stub TypeScript definitions entry for winston, which provides its own types definitions
This is a stub types definition for winston (https://github.com/winstonjs/winston.git).
winston provides its own type definitions, so you don't need @types/winston installed!
.js to main entry point in package.json in https://github.com/winstonjs/winston/pull/2177; thanks to new contributor @rumanbslThanks especially to new contributors @zizifn, @arpad1337, @domiins, & @jeanpierrecarvalho!
This change reverts what should have been the feature-level update in 3.7.0 due to issue #2103 showing this to be breaking, unintentionally.
This change includes some minor updates to package-lock.json resolving npm audit failures: one in ansi-regex and another in minimist.
Feature-level updates:
Patch-level updates:
process.nextTick before clearing pending callbacks (thanks @smashah!)logform 2.4.0, which includes changes such as new options for JsonOptions and some typo fixes regarding levelsThis release reverts the changes made in PR #1896 which added stricter typing to the available log levels, and inadvertently broke use of custom levels with TypeScript (Issue #2047). Apologies for that!
This release includes the following, in sequence by first merge in group:
Feature updates:
Patch-level updates:
.rejections
(#1842, #1929, #2021; thanks @vanflux, @svaj, @glensc, & others!)stringify, e.g. to avoid issues from circular structures, in the http transport
(#2043, thanks @karlwir!)Updates to the repo & project which don’t actually affect the running code:
Thanks also to maintainers @DABH, @fearphage, @Maverick1872, and @wbt for issue/PR shepherding and help across multiple parts of the release! If somebody got missed in the list of thanks, please forgive the accidental oversight and/or feel free to open a PR on this changelog.
Yesterday's release was done with a higher sense of urgency than usual
due to vandalism in the colors package.
This release:
The biggest change in this release, motivating the feature-level update, is [#2006] Make winston more ESM friendly, thanks to @miguelcobain.
Thanks also to @DABH, @wbt, and @fearphage for contributions and reviews!
Compared to v3.3.3, this version fixes some issues and includes some updates to project infrastructure, such as replacing Travis with Github CI and dependabot configuration. There have also been several relatively minor improvements to documentation, and incorporation of some updated dependencies. Dependency updates include a critical bug fix [#2008] in response to self-vandalism by the author of a dependency.
diagnostics published to NPM to avoid git dependency.info.message and meta.message.child property on default logger.createLogger for level convenience methods (e.g. .info(), .silly()).
(Fixes [#1577]).NOTE: this was our first release using Github Projects. See the 3.2.0 Release Project.
new Error(string)
throughout the pipeline(s). (Fixes [#1338], [#1486]).warn events up to logger in
addition to errors.readable-stream using CRA.3.0.0)exitOnError.splat behaviorwinston and logform.SPLAT to formats (Fixes [#1485]).Previously 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. BE ADVISED previous "metas" that were not objects will very likely
lead to odd behavior. e.g.
const { createLogger, format, transports } = require('winston');
const { splat } = format;
const { MESSAGE, LEVEL, SPLAT } = require('triple-beam');
const logger = createLogger({
format: format.combine(
format.splat(),
format.json()
),
transports: [new transports.Console()]
});
// Expects two tokens, but four splat parameters provided.
logger.info(
'Let us %s for %j', // message
'objects', // used for %s
{ label: 'sure' }, // used for %j
'lol', ['ok', 'why'] // Multiple additional meta values
);
// winston < 3.2.0 && 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' } ] }
// winston >= 3.2.0 && logform@2.x behavior: Enumerable properties
// assigned into `info`. Since **strings and Arrays only have NUMERIC
// enumerable properties we get this behavior!**
//
// { '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' } ] }README.md for awaiting logs.ConsoleTransportOptions interface type definition.child() method.readable-stream to v3.0.6.@types/node, nyc, and through2.consoleWarnLevels property to console transport options for console.warn browser support.tailing: true (Fixes [#1450], [#1194]).isLevelEnabled(string) & isXXXEnabled() to Logger class.package-lock.json.colors@^1.3.2 (Fixes [#1439]).logform@^1.9.1.diagnostics@^1.1.1.@types/node@^10.9.3.assume@^2.1.0.hock@^1.3.3.mocha@^5.2.0.nyc@^13.0.1.split2@^3.0.0._final from Node.js streams. (Related to winston-transport#24, Fixes [#1250]).format.transform with try / catch (Fixes [#1261]).colorize
to address concerns in [#1095].docs/transports.md.package-lock.json.logform@^1.9.0.winston@3.0.0File transport core functionality. Fixes [#1194].eol option to Stream transport.winston.config to triple-beam. Expose
for backwards compatibility.winston-transport@4.0.0 which may cause incompatibilities if
your custom transport does not explicitly require winston-transport
itself.UPGRADE-3.0.md. Add Github Issue Template.logform, triple-beam, and winston-transport to latest.Special thanks to our newest
winstoncore team member – @ChrisAlderson for helping makewinston@3.0.0a reality next week!
Buffer.alloc and Buffer.from instead of new Buffer.winston@3.0.0UPGRADE-3.0.md3.0.0.md into CONTRIBUTING.md and other
improvements to CONTRIBUTING.mdhumanReadableUnhandledException is now the default message format.README.md is correct.devDependenciesassume to ^2.0.1.winston-compat to ^0.1.1.{ silent } option torequire('winston').Logger;
require('winston-transport').TransportStream;isstream with is-stream to make stream detection work in browser.logform@1.4.1CONTRIBUTING.mdv3.0.0-rc3{ level } can be deleted from info objects because Symbol.for('level') is what winston uses internally. Fixes #1184.new stream.Stream()self.filename was not being updated on ENOENTundefined, null and Error valuesmeta objects BECOME the info objectasync to latest (2.6.0)fs.close._onDrain and _onError #1104See UPGRADE-3.0.md for a complete & living upgrade guide.
See 3.0.0.md for a list of remaining RC tasks.
Logger & Transport are now implemented using Node.js objectMode streams.filters, rewriters, and common.log are now formats: winston.format offers a simple mechanism for user-land formatting & style features. The organic & frankly messy growth of common.log is of the past; these feature requests can be implemented entirely outside of winston itself.
``` js
const { createLogger, format, transports } = require('winston');
const { combine, timestamp, label, printf } = format;const myFormat = printf(info => {
return ${info.timestamp} [${info.label}] ${info.level}: ${info.message};
});
const logger = createLogger({ combine( label({ label: 'right meow!' }), timestamp(), myFormat ), transports: [new transports.Console()] });
- **Increased modularity:** several subsystems are now stand-alone packages:
- [logform] exposed as `winston.format`
- [winston-transport] exposed as `winston.Transport`
- [abstract-winston-transport] used for reusable unit test suites for transport authors.
- **`2.x` branch will get little to no maintenance:** no feature requests will be accepted – only a limited number of open PRs will be merged. Hoping the [significant performance benefits][perf-bench] incentivizes folks to upgrade quickly. Don't agree? Say something!
- **No guaranteed support for `node@4` or below:** all code will be migrated to ES6 over time. This release was started when ES5 was still a hard requirement due to the current LTS needs.
## v2.4.0 / 2017-10-01
### ZOMFG WINSTON@3.0.0-RC0 EDITION
- [#1036] Container.add() 'filters' and 'rewriters' option passing to logger.
- [#1066] Fixed working of "humanReadableUnhandledException" parameter when additional data is added in meta.
- [#1040] Added filtering by log level
- [#1042] Fix regressions brought by `2.3.1`.
- Fix regression on array printing.
- Fix regression on falsy value.
- [#977] Always decycle objects before cloning.
- Fixes [#862]
- Fixes [#474]
- Fixes [#914]
- [57af38a] Missing context in `.lazyDrain` of `File` transport.
- [178935f] Suppress excessive Node warning from `fs.unlink`.
- [fcf04e1] Add `label` option to `File` transport docs.
- [7e736b4], [24300e2] Added more info about undocumented `winston.startTimer()` method.
- [#1076], [#1082], [#1029], [#989], [e1e7188] Minor grammatical & style updates to `README.md`.
## v2.3.1 / 2017-01-20
### WELCOME TO THE APOCALYPSE EDITION
- [#868](https://github.com/winstonjs/winston/pull/868), Fix 'Maximum call stack size exceeded' error with custom formatter.
## v2.3.0 / 2016-11-02
### ZOMG WHY WOULD YOU ASK EDITION
- Full `CHANGELOG.md` entry forthcoming. See [the `git` diff for `2.3.0`](https://github.com/winstonjs/winston/compare/2.2.0...2.3.0) for now.
## v2.2.0 / 2016-02-25
### LEAVING CALIFORNIA EDITION
- Full `CHANGELOG.md` entry forthcoming. See [the `git` diff for `2.2.0`](https://github.com/winstonjs/winston/compare/2.1.1...2.2.0) for now.
## v2.1.1 / 2015-11-18
### COLOR ME IMPRESSED EDITION
- [#751](https://github.com/winstonjs/winston/pull/751), Fix colors not appearing in non-tty environments. Fixes [#609](https://github.com/winstonjs/winston/issues/609), [#616](https://github.com/winstonjs/winston/issues/616), [#669](https://github.com/winstonjs/winston/issues/669), [#648](https://github.com/winstonjs/winston/issues/648) (`fiznool`).
- [#752](https://github.com/winstonjs/winston/pull/752) Correct syslog RFC number. 5424 instead of 524. (`jbenoit2011`)
## v2.1.0 / 2015-11-03
### TEST ALL THE ECOSYSTEM EDITION
- [#742](https://github.com/winstonjs/winston/pull/742), [32d52b7](https://github.com/winstonjs/winston/commit/32d52b7) Distribute common test files used by transports in the `winston` ecosystem.
## v2.0.1 / 2015-11-02
### BUGS ALWAYS HAPPEN OK EDITION
- [#739](https://github.com/winstonjs/winston/issues/739), [1f16861](https://github.com/winstonjs/winston/commit/1f16861) Ensure that `logger.log("info", undefined)` does not throw.
## v2.0.0 / 2015-10-29
### OMG IT'S MY SISTER'S BIRTHDAY EDITION
#### Breaking changes
**Most important**
- **[0f82204](https://github.com/winstonjs/winston/commit/0f82204) Move `winston.transports.DailyRotateFile` [into a separate module](https://github.com/winstonjs/winston-daily-rotate-file)**: `require('winston-daily-rotate-file');`
- **[fb9eec0](https://github.com/winstonjs/winston/commit/fb9eec0) Reverse log levels in `npm` and `cli` configs to conform to [RFC524](https://tools.ietf.org/html/rfc5424). Fixes [#424](https://github.com/winstonjs/winston/pull/424) [#406](https://github.com/winstonjs/winston/pull/406) [#290](https://github.com/winstonjs/winston/pull/290)**
- **[8cd8368](https://github.com/winstonjs/winston/commit/8cd8368) Change the method signature to a `filter` function to be consistent with `rewriter` and log functions:**
``` js
function filter (level, msg, meta, inst) {
// Filter logic goes here...
}Other breaking changes
winston.transports.Webhook. Use winston.transports.Http instead.Logger.prototype.addRewriter and Logger.prototype.addFilter since they just push to an Array of functions. Use logger.filters.push or logger.rewriters.push explicitly instead.handleExceptions option to new winston.Logger. Instead just pass in the exceptionHandlers option itself.Logger.prototype.extend functionalityLogger.prototype.configure which now contains all logic previously in the winston.Logger constructor function. (indexzero)coreybutler)eol option to the Console transport. (aquavitae)lib/transports.js for better static analysis. (indexzero)File transport to be an objectMode writable stream. (stambata)indexzero)indexzero)jcrugzz)harriha).wesleyeff)paulhroth)christophehurpeau)paulhroth, kikobeats)timdp)The Gitter Badger)logException. Fixes #218 #213 #327. (indexzero)tailFile function working on latest/all node versions (Christopher Jeffrey)Roman Stetsyshin)indexzero)Roderick Hsiao)Stefan Thies, charukiewicz, unLucio, Adam Cohen, Denis Gorbachev, Frederik Ring, Luigi Pinca, jeffreypriebe)indexzero)marcus)package.json updates cec892c, 2f13b4f, b246efd, 22a5f5a, 5868b78, 99b6b44, 447a813, 7f75b48 (peteward44, Gilad Peleg, Anton Ian Sipos, nimrod-becker, LarsTi, indexzero)String prototypes as a side effect of using colors. (kenperkins)error on error of the underlying streams after maxRetries attempts. (ambbell).os.EOL for all file writing by default. (Mik13, indexzero)Container when close event is emitted. (snater)duration to durationMs, which is now a number a not a string ending in ms. (neoziro)level is falsey on any Transport instance, any Logger instance uses the configured level (instead of the Transport level) (jstamerj).maxFiles in File transport (Fixes #556).showLevel support to File transport.showLevel support to Console transport.oojacoboo).node >= 0.8.0. (indexzero)samz)neouser99)Melnyk Andii)Tony Germaneri)Alberto Pose)Alberto Pose)Chris Oloff)Michiel De Mey)Leonard Martin)indexzero)Loïc Mahieu)John Frizelle)indexzero)until before a default from. Fixes #478. (indexzero)Chasen Le Hara)José F. Romaniello)José F. Romaniello)Ricardo Torres)Alberto Pose)res.resume() in HttpTransport to get around known issues in streams2. (indexzero)Jacob Thomason)Ramon Snir)Michael Neil)Matt Zukowski)orcaman)jupiter)isstream for file transport (jcrugzz)jcrugzz)indexzero)indexzero)indexzero)unlucio)indexzero)indexzero)http transport (indexzero)francoisTemasys)adriano-di-giovanni, indexzero)gdw2, indexzero)danilo1105, indexzero)revington)arxony)gmajoulet)query methods from Transports. Fixes #356. (indexzero)calvinfo)machadogj)pose)stringify option