@arcjet/logger
v1.0.0-beta.15
Published
Arcjet lightweight logger which mirrors the Pino structured logger interface
Downloads
94,150
Readme
@arcjet/logger
Arcjet lightweight logger which mirrors the Pino structured logger interface.
What is this?
This is an internal utility to help us log things. It provides a small interface, a bit like Pino, so that users with custom needs can swap it for their own logger.
When should I use this?
You should probably not use this but use one of the alternatives instead. This package matches our current needs which are likely different from yours.
Install
This package is ESM only. Install with npm in Node.js:
npm install @arcjet/loggerExample
import { Logger } from "@arcjet/logger";
const logger = new Logger({ level: "debug" });
logger.debug("only printed in debug mode");
// Logs ✦Aj DEBUG only printed in debug mode
logger.error("%d + %d = %d", 1, 2, 3);
// Logs ✦Aj ERROR 1 + 2 = 3Log levels
Log levels can be changed by setting the ARCJET_LOG_LEVEL environment variable
to one of: "DEBUG", "LOG", "WARN", or "ERROR".
