这个项目能做什么

modern-errors-winston is a Winston plugin for the modern-errors library that improves how JavaScript errors are logged in Node.js applications. It provides two main Winston format helpers: BaseError.fullFormat() and BaseError.shortFormat(). The full format is intended for structured logging and includes all error properties, such as name, message, stack, custom properties, nested cause errors, and AggregateError entries. It is designed to be combined with formats like format.json() or format.prettyPrint(), and is especially useful with transports such as HTTP. The output is described as JSON-safe, which makes it suitable for machine-readable logs and remote log ingestion. The short format is intended for human-readable console output. It logs only the error name, message, and optionally the stack trace. It is designed to be combined with formats like format.simple() or format.cli(), and is useful with console transports. The plugin can be configured at several levels, including per error class, per subclass, per error instance, and per format call. Configuration options include whether to include the stack trace and an optional override for the Winston log level. It also works with uncaught exceptions when used with Winston's exception handling. Compared with Winston's default error format, this plugin logs the error name, supports nested errors including cause and aggregate errors, produces JSON-safe full output, allows optional stack traces in the short format, and does not modify the error instance. The package is an ES module, requires Node.js 18.18.0 or newer, and requires Winston to be installed separately.