The Logger
Migrate from the old logger package to hepgg/logger, meet the whole hepgg package, then learn the logger in full. A deliberately good-looking console logger for Team Hydra services and bots.
The Logger
The logger that powers Team Hydra's services, members' projects, and bots now ships inside the unified hepgg package on the hepgg/logger subpath. It is not trying to be a "serious" structured logger. It is trying to make your terminal look fantastic.
Migrating From The logger Package
The standalone logger package is deprecated. Moving over is a one-line change to your import. Every method you already use still works.
- const logger = require("logger");
+ const logger = require("hepgg/logger");- import logger from "logger";
+ import logger from "hepgg/logger";The shared singleton, every method (debug / info / warning / error / severe / log), and setLevel / time / write behave exactly as before. You also get new levels (trace, success, warn, fatal), coloured scopes via child(), and createLogger() for free. See Using The Logger below for everything new.
First install the package (next section), then change the import. That is the whole migration.
The hepgg Package
The logger is one module of hepgg, the single package that replaced Team Hydra's and Hep.gg's separate client libraries. Install it once and you have all of these. Most are documented on the Hep.gg docs.
npm install hepgg --registry https://npm.hep.ggecho 'registry=https://npm.hep.gg' >> .npmrc
npm install hepggNode 20 or newer. Colour is bundled, so the logger works the moment you import it. Zero other dependencies.
This page. Pretty console logging via hepgg/logger.
UUID, NanoID, snowflake, license keys, and more via hepgg/id.
Send texts and handle inbound webhooks via hepgg/sms.
Transactional email via hepgg/email.
File hosting and URL shortening via hepgg/uploader.
Create and read pastes via hepgg/paste.
Pull secrets into process.env via hepgg/secrets.
Read AI Gateway usage and quotas via hepgg/ai.
Add "Sign in with Hep.gg" via hepgg/login.
So yes: if your bot is going to log beautifully, it can also text you, email you, and mint its own IDs from the same install. See the Hep.gg SDK docs and the full migration guide for the other packages.
Using The Logger
Output is read in pm2 or straight in the process, so it leans all the way into colour: a dim timestamp, a colour-bracketed uppercase level tag of uniform width, then your message.
The Two-Line Quickstart
import logger from "hepgg/logger";
logger.info("Starting server...");
logger.success("Listening on http://localhost:3000");const logger = require("hepgg/logger");
logger.info("Starting server...");
logger.success("Listening on http://localhost:3000");That prints (in colour, with the brackets and labels tinted per level):
[06/09/2026 - 08:20 AM] [INFO ]: Starting server...
[06/09/2026 - 08:20 AM] [SUCCESS]: Listening on http://localhost:3000Every level lines up because each label is padded to the same width inside its brackets.
The Levels
Seven levels, lowest to highest severity. The old names still work, so nothing you already wrote breaks.
| Method | Colour | Notes |
|---|---|---|
logger.trace(...) | grey | Fine-grained tracing. |
logger.debug(...) | grey | Debugging detail. |
logger.info(...) | sky blue | Normal information. |
logger.success(...) | green | A good thing happened. |
logger.warn(...) | amber | Something is off. logger.warning(...) is an alias. |
logger.error(...) | red | Something failed. |
logger.fatal(...) | white on red | The end is nigh. logger.severe(...) is an alias. |
logger.log(...) is an alias for info. Objects and Errors are inspected for you.
The current level is a threshold: a message prints when its severity is at or above it. Set it with the LEVEL environment variable or logger.setLevel("warn").
Scopes
Tag a logger with a scope so you can tell subsystems apart. child() adds a coloured [scope] after the level, and children nest.
const db = logger.child("db");
db.info("connected"); // [..] [INFO ] [db]: connected
logger.child("api").child("auth").warn("token near expiry"); // [api:auth]Your Own Loggers
The default export is a shared singleton. For an independent instance (its own level, colours, or file), use createLogger.
import { createLogger } from "hepgg/logger";
const log = createLogger({ level: "trace" });Files
By default every line is also appended to events.log as plain text (no colour codes). Point it elsewhere, or turn it off.
createLogger({ file: "/var/log/myapp.log" }); // custom path
createLogger({ file: false }); // console onlyThe LOG_FILE environment variable overrides the default path (LOG_FILE=false disables it). The file format is YYYY/MM/DD HH:MM:SS [LEVEL ] message.
Colour In pm2
pm2 captures stdout, which usually makes loggers turn colour off. This one forces colour on by default precisely because it expects to be read in pm2 or piped, so your logs stay bright. Set the standard NO_COLOR when you want plain output.
NO_COLOR=1 node server.js # plain, no escape codesPower-User Options
createLogger(options) accepts:
| Option | Type | Default | What it does |
|---|---|---|---|
level | string | LEVEL env, else info | Initial threshold. Canonical names and aliases. |
color | boolean or "auto" | forced on | true forces colour; "auto" follows TTY detection; false off. NO_COLOR always wins. |
timestamp | string or function or false | "datetime" | "datetime", "time", "iso", a (date) => string, or false. |
file | boolean or string | events.log | A path, or false to disable. |
colors | object | built-in palette | Override the hex colour per level. |
scope | string | none | A scope tag (usually set via child()). |
stream | stream | process.stdout | Where console lines go. |
import { createLogger } from "hepgg/logger";
const log = createLogger({
timestamp: "iso",
colors: { info: "#00e5ff", success: "#7CFC00", warn: "#ffb000" },
});