Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: build
name: Build package
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 19.x, 20.x, 22.x]
node-version: [22.x, 24.x, 26.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.DS_Store
.env
.history/
.vscode/
coverage/
lib/
lib-test/
node_modules/
npm-debug.log
*.log
Empty file removed .nojekyll
Empty file.
6 changes: 3 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
.agents/
.DS_Store
.env
.nojekyll
.git/
.github/
.history/
.prettierignore
AGENTS.md
coverage/
docs/
src/
test/
lib-test/
CNAME
History.md
Makefile
tsconfig*.json
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

142 changes: 142 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Changelog for Anyhow

## 4.0.0

- BREAKING: Requires Node.js 22 or newer.
- NEW: Native ESM support via package exports, alongside CommonJS.
- NEW: Option `levelMap` to map Anyhow log levels to levels supported by the configured logger or console.
- The `debug()` now logs the full JSON of passed objects, with only the `maskSecrets` preprocessor applied.
- The `friendlyErrors` preprocessor now supports `fetch()` network failures and responses.
- Fixed `friendlyErrors` not extracting the messages of nested errors.
- Fixed `info()` logs not masking secrets with the `maskSecrets` preprocessor.
- Fixed `setup("pino", options)` ignoring the passed options.
- Fixed `cleanup` not replacing nested functions and not formatting dates.
- Fixed masking secrets changing nested values of the logged objects.
- Fixed Google Cloud setup failing when passing a `logName`, and the log name now defaults to the `appName`.
- Fixed uncaught exceptions and unhandled rejections being logged multiple times after changing options.

## 3.4.0

- Check for an additional "errors" array when getting friendly error messages.

## 3.3.0

- Expanded the list of masked fields.
- Masked field keys are now case insensitive.
- Default `maxDepth` increased from 6 to 10.
- Code refactoring.

## 3.2.0

- Removed pre v3 deprecated methods.
- Default `maxDepth` increased from 5 to 6.

## 3.1.1

- Removed "sneaky" TEST log.

## 3.1.0

- Fixed timestamp feature (was being added multiple times).
- Fixed default Google Cloud logger.

## 3.0.4

- Removed the "util/types" dependency on utils.
- The `errorStack` was pointing to the wrong location, now fixed (`preprocessorOptions.errorStack`).

## 3.0.2

- Added "Authorization" to list of default masked fields.
- Handling improvements to the "cleanup" and "friendlyErrors" preprocessors.
- The "friendlyErrors" preprocessor is ignored on debug and info logs.

## 3.0.1

- Added missing default separator, switched back from "," to " | ".

## 3.0.0

- Major code refactoring!
- BREAKING: Library options now contained within the new `logger.options` property.
- NEW: A few new logging helpers:
- `deprecated()`: logs a deprecation warning (only once).
- `inspect()`: outputs the JSON representation of the passed objects / variables.
- NEW: Built-in preprocessors:
- `cleanup`: remove unnecessary gibberish from logged objects.
- `friendlyErrors`: extract the most relevant data from error and exceptions.
- `maskSecrets`: mask passwords, tokens and credentials on objects.

## 2.2.2

- Removed lodash references from testing.

## 2.2.0

- Improved error parsing.
- Removed lodash dependency.

## 2.1.0

- The chalk module will only be instantiated if using console as the logger.

## 2.0.5

- The `parser.getMessage()` helper is now exposed on the main module.

## 2.0.0

- NEW: Support for Google Cloud Logging (formerly Stackdriver).
- NEW: Support for custom loggers.
- Major code refactoring.

## 1.5.5

- Improved parsing of errors, now getting message from axios responses.

## 1.5.1

- Force flatten arrays on `getMessage()`.

## 1.5.0

- TypeScript types are now exported with the library.

## 1.4.0

- NEW: Option `unhandledRejections` to auto log unhandled rejections, defaults to false.
- NEW: Option `appName` to define the name or title of the running app.

## 1.3.0

- NEW: Option `timestamp` to prepend timestamp on logged messages.

## 1.2.2

- Check for level on log shortcuts (debug, info, warn, error).

## 1.2.1

- Option `levelOnConsole` also works when messages are stylized (using chalk).

## 1.2.0

- NEW: Option `uncaughtExceptions` to auto log uncaught exceptions, defaults to false.
- NEW: Option `levelOnConsole` to output log level to console, defaults to false.

## 1.1.3

- Removed `.git` from package.

## 1.1.2

- Calling `log()` before `setup()` will warn and default to console.

## 1.1.0

- NEW: Added support for Pino.
- NEW: Property `lib` defining the underlying library.

## 1.0.0

- Initial release.
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

199 changes: 0 additions & 199 deletions History.md

This file was deleted.

Loading
Loading