@plandek-utils/logging 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,216 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ LOG_LEVELS: () => LOG_LEVELS,
34
+ buildPinoLogger: () => buildPinoLogger,
35
+ buildSinkLogger: () => buildSinkLogger,
36
+ colorPrettyJSON: () => colorPrettyJSON,
37
+ colourPrettyJSON: () => colourPrettyJSON,
38
+ isLoggingWithRecords: () => isLoggingWithRecords,
39
+ makeColourUtils: () => makeColourUtils,
40
+ makeLogging: () => makeLogging,
41
+ makeLoggingWithRecord: () => makeLoggingWithRecord,
42
+ parseLogLevelOrDefault: () => parseLogLevelOrDefault,
43
+ prettyJSON: () => prettyJSON
44
+ });
45
+ module.exports = __toCommonJS(index_exports);
46
+ var import_chalk = __toESM(require("chalk"));
47
+ var import_json_colorizer = require("json-colorizer");
48
+ var import_pino = require("pino");
49
+ var LOG_LEVELS = [
50
+ "fatal",
51
+ "error",
52
+ "warn",
53
+ "info",
54
+ "debug",
55
+ "trace",
56
+ "silent"
57
+ ];
58
+ function parseLogLevelOrDefault(level, defaultLevel) {
59
+ if (!level) return defaultLevel;
60
+ const lowerLevel = level.toLowerCase();
61
+ if (LOG_LEVELS.includes(lowerLevel)) {
62
+ return lowerLevel;
63
+ }
64
+ throw new Error(`Invalid log level: ${level}`);
65
+ }
66
+ function buildPinoLogger(level, redactPaths) {
67
+ const paths = redactPaths ?? [
68
+ "req.headers.authorization",
69
+ "req.headers.cookie"
70
+ ];
71
+ return (0, import_pino.pino)({
72
+ level,
73
+ timestamp: import_pino.pino.stdTimeFunctions.isoTime,
74
+ redact: { paths, censor: "[REDACTED]" }
75
+ });
76
+ }
77
+ function buildSinkLogger(level, givenBindings) {
78
+ const bindings = givenBindings ?? {};
79
+ return {
80
+ level,
81
+ info: () => {
82
+ },
83
+ debug: () => {
84
+ },
85
+ warn: () => {
86
+ },
87
+ error: () => {
88
+ },
89
+ child: (childBindings) => buildSinkLogger(level, { ...bindings, ...childBindings }),
90
+ bindings: () => bindings
91
+ };
92
+ }
93
+ function prettyJSON(obj) {
94
+ return JSON.stringify(obj, null, 2);
95
+ }
96
+ function colourPrettyJSON(obj) {
97
+ return (0, import_json_colorizer.colorize)(prettyJSON(obj));
98
+ }
99
+ var colorPrettyJSON = colourPrettyJSON;
100
+ function makeColourUtils(mode) {
101
+ if (mode === "with-colour") {
102
+ return {
103
+ blue: (x) => import_chalk.default.blue(x),
104
+ cyan: (x) => import_chalk.default.cyan(x),
105
+ gray: (x) => import_chalk.default.gray(x),
106
+ magenta: (x) => import_chalk.default.magenta(x),
107
+ red: (x) => import_chalk.default.red(x),
108
+ yellow: (x) => import_chalk.default.yellow(x)
109
+ };
110
+ }
111
+ if (mode === "plain") {
112
+ return {
113
+ blue: (x) => x,
114
+ cyan: (x) => x,
115
+ gray: (x) => x,
116
+ magenta: (x) => x,
117
+ red: (x) => x,
118
+ yellow: (x) => x
119
+ };
120
+ }
121
+ const _never = mode;
122
+ throw new Error(`Unknown mode: ${_never}`);
123
+ }
124
+ function isLoggingWithRecords(obj) {
125
+ return "messages" in obj;
126
+ }
127
+ function makeLogging(opts) {
128
+ const logger = loggerFor(
129
+ opts.logger,
130
+ opts.section ?? null,
131
+ opts.context ?? null
132
+ );
133
+ return {
134
+ logger,
135
+ info: (msg, obj) => logger.info(obj, msg),
136
+ debug: (msg, obj) => logger.debug(obj, msg),
137
+ warn: (msg, obj) => logger.warn(obj, msg),
138
+ error: (msg, obj) => logger.error(obj, msg),
139
+ getSections() {
140
+ return getSectionsFromLogger(logger);
141
+ },
142
+ withSection(section, context) {
143
+ if (this.getSections().includes(section)) return this;
144
+ return makeLogging({ logger: this.logger, section, context });
145
+ }
146
+ };
147
+ }
148
+ function makeLoggingWithRecord(opts) {
149
+ const logging = makeLogging(opts);
150
+ const messages = opts.messages ?? {
151
+ info: [],
152
+ warn: [],
153
+ debug: [],
154
+ error: []
155
+ };
156
+ function makeLogFn(logFn, key) {
157
+ return (msg, obj) => {
158
+ messages[key].push([msg, obj ?? null]);
159
+ return logFn(msg, obj);
160
+ };
161
+ }
162
+ return {
163
+ messages,
164
+ logger: logging.logger,
165
+ info: makeLogFn(logging.info, "info"),
166
+ debug: makeLogFn(logging.debug, "debug"),
167
+ warn: makeLogFn(logging.warn, "warn"),
168
+ error: makeLogFn(logging.error, "error"),
169
+ getSections() {
170
+ return logging.getSections();
171
+ },
172
+ withSection(section, context) {
173
+ return makeLoggingWithRecord({
174
+ logger: this.logger,
175
+ section,
176
+ messages,
177
+ context
178
+ });
179
+ }
180
+ };
181
+ }
182
+ function loggerFor(givenLogger, section, context) {
183
+ if (!context && (!section || loggerHasSection(givenLogger, section))) {
184
+ return givenLogger;
185
+ }
186
+ const childBindings = { ...context };
187
+ if (section) {
188
+ childBindings.logSections = [
189
+ ...getSectionsFromLogger(givenLogger),
190
+ section
191
+ ];
192
+ }
193
+ return givenLogger.child(childBindings);
194
+ }
195
+ function getSectionsFromLogger(logger) {
196
+ return logger.bindings().logSections ?? [];
197
+ }
198
+ function loggerHasSection(logger, section) {
199
+ const sections = getSectionsFromLogger(logger);
200
+ return sections.includes(section);
201
+ }
202
+ // Annotate the CommonJS export names for ESM import in node:
203
+ 0 && (module.exports = {
204
+ LOG_LEVELS,
205
+ buildPinoLogger,
206
+ buildSinkLogger,
207
+ colorPrettyJSON,
208
+ colourPrettyJSON,
209
+ isLoggingWithRecords,
210
+ makeColourUtils,
211
+ makeLogging,
212
+ makeLoggingWithRecord,
213
+ parseLogLevelOrDefault,
214
+ prettyJSON
215
+ });
216
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport { colorize } from \"json-colorizer\";\nimport type { Logger as PinoLogger } from \"pino\";\nimport { pino } from \"pino\";\nimport type { DeepReadonly } from \"simplytyped\";\n\nimport type {\n\tPlainObject,\n\tPlainObjectValue,\n} from \"@plandek-utils/plain-object\";\n\n/**\n * Allowed log levels for the logger.\n */\nexport const LOG_LEVELS = [\n\t\"fatal\",\n\t\"error\",\n\t\"warn\",\n\t\"info\",\n\t\"debug\",\n\t\"trace\",\n\t\"silent\",\n] as const;\n\n/**\n * Possible log levels for preparing the pino logger.\n */\nexport type LogLevel = (typeof LOG_LEVELS)[number];\n\n/**\n * Parses the given log level, or returns the default level if it's not blank. If it is an invalid level it will throw an error.\n */\nexport function parseLogLevelOrDefault(\n\tlevel: string | null | undefined,\n\tdefaultLevel: LogLevel,\n): LogLevel {\n\tif (!level) return defaultLevel;\n\n\tconst lowerLevel = level.toLowerCase() as LogLevel;\n\tif (LOG_LEVELS.includes(lowerLevel)) {\n\t\treturn lowerLevel;\n\t}\n\n\tthrow new Error(`Invalid log level: ${level}`);\n}\n\n/**\n * Prepared pino logger, returned by `buildPinoLogger` or `buildSinkLogger`.\n *\n * @see buildPinoLogger\n * @see buildSinkLogger\n */\nexport type PreparedLogger = Pick<\n\tPinoLogger,\n\t\"level\" | \"info\" | \"debug\" | \"warn\" | \"error\" | \"bindings\"\n> & {\n\tchild: (bindings: PlainObject) => PreparedLogger;\n};\n\n/**\n * Prepares a Pino logger with the common configuration.\n *\n * @param level - The log level to use.\n * @param redactPaths - Paths to redact from the logs. Defaults to `[\"req.headers.authorization\", \"req.headers.cookie\"]`.\n * @returns PinoLogger\n */\nexport function buildPinoLogger(\n\tlevel: LogLevel,\n\tredactPaths?: string[],\n): PreparedLogger {\n\tconst paths = redactPaths ?? [\n\t\t\"req.headers.authorization\",\n\t\t\"req.headers.cookie\",\n\t];\n\treturn pino({\n\t\tlevel,\n\t\ttimestamp: pino.stdTimeFunctions.isoTime,\n\t\tredact: { paths, censor: \"[REDACTED]\" },\n\t});\n}\n\n/**\n * A mock logger that does nothing, holds no binding (sections).\n */\nexport function buildSinkLogger(\n\tlevel: LogLevel,\n\tgivenBindings?: PlainObject,\n): PreparedLogger {\n\tconst bindings = givenBindings ?? {};\n\treturn {\n\t\tlevel,\n\t\tinfo: () => {},\n\t\tdebug: () => {},\n\t\twarn: () => {},\n\t\terror: () => {},\n\t\tchild: (childBindings?: PlainObject) =>\n\t\t\tbuildSinkLogger(level, { ...bindings, ...childBindings }),\n\t\tbindings: () => bindings,\n\t};\n}\n\n/**\n * Util to serialise as JSON the given value, pretty-printed (2 spaces).\n */\nexport function prettyJSON(obj: unknown): string {\n\treturn JSON.stringify(obj, null, 2);\n}\n\n/**\n * Calls `prettyJSON` and then colourises the output.\n */\nexport function colourPrettyJSON(obj: unknown): string {\n\treturn colorize(prettyJSON(obj));\n}\n\n/**\n * Alias for `colourPrettyJSON`.\n * @see colourPrettyJSON\n */\nexport const colorPrettyJSON = colourPrettyJSON;\n\n/**\n * Interface to provide colouring for logs.\n */\nexport type LogColourUtils = {\n\tblue: (x: string) => string;\n\tcyan: (x: string) => string;\n\tgray: (x: string) => string;\n\tmagenta: (x: string) => string;\n\tred: (x: string) => string;\n\tyellow: (x: string) => string;\n};\n\n/**\n * Creates a LogColourUtils object, with actual colours or not depending on the given mode.\n *\n * @param mode: if \"with-colour\", it will return a set of functions that will colour the given string. If \"plain\", it will return a set of functions that will return the string as is.\n */\nexport function makeColourUtils(mode: \"with-colour\" | \"plain\"): LogColourUtils {\n\tif (mode === \"with-colour\") {\n\t\treturn {\n\t\t\tblue: (x: string) => chalk.blue(x),\n\t\t\tcyan: (x: string) => chalk.cyan(x),\n\t\t\tgray: (x: string) => chalk.gray(x),\n\t\t\tmagenta: (x: string) => chalk.magenta(x),\n\t\t\tred: (x: string) => chalk.red(x),\n\t\t\tyellow: (x: string) => chalk.yellow(x),\n\t\t};\n\t}\n\n\tif (mode === \"plain\") {\n\t\treturn {\n\t\t\tblue: (x: string) => x,\n\t\t\tcyan: (x: string) => x,\n\t\t\tgray: (x: string) => x,\n\t\t\tmagenta: (x: string) => x,\n\t\t\tred: (x: string) => x,\n\t\t\tyellow: (x: string) => x,\n\t\t};\n\t}\n\n\tconst _never: never = mode;\n\tthrow new Error(`Unknown mode: ${_never}`);\n}\n\n/**\n * Logging interface. Requires a message (string) and optionally an object to log, which is required to be a Plain Object to ensure serialisation.\n */\ntype LogFn = (msg: string, obj?: DeepReadonly<PlainObject>) => void;\n\n/**\n * Logging interface that provides a way to log messages with different levels. It should be configured with sections. It can return a new instance with a new section.\n */\nexport type Logging = {\n\tlogger: PreparedLogger;\n\tinfo: LogFn;\n\twarn: LogFn;\n\tdebug: LogFn;\n\terror: LogFn;\n\tgetSections(this: Logging): string[];\n\twithSection(this: Logging, section: string, context?: PlainObject): Logging;\n};\n\n/**\n * Variant of the Logging interface that stores the messages that have been logged.\n */\nexport type LoggingWithRecords = Omit<Logging, \"withSection\"> & {\n\twithSection(\n\t\tthis: Logging,\n\t\tsection: string,\n\t\tcontext?: PlainObject,\n\t): LoggingWithRecords;\n\tmessages: {\n\t\tinfo: Array<[string, PlainObject | null]>;\n\t\twarn: Array<[string, PlainObject | null]>;\n\t\tdebug: Array<[string, PlainObject | null]>;\n\t\terror: Array<[string, PlainObject | null]>;\n\t};\n};\n\n/**\n * Checks if the given Logging object is a LoggingWithRecords.\n * @param obj\n * @returns\n */\nexport function isLoggingWithRecords(obj: Logging): obj is LoggingWithRecords {\n\treturn \"messages\" in obj;\n}\n\n/**\n * Creates a Logging object. It requires an actual pino logger to be sent, and optionally a section and a context.\n */\nexport function makeLogging(opts: {\n\tsection?: string;\n\tcontext?: PlainObject;\n\tlogger: PreparedLogger;\n}): Logging {\n\tconst logger = loggerFor(\n\t\topts.logger,\n\t\topts.section ?? null,\n\t\topts.context ?? null,\n\t);\n\n\treturn {\n\t\tlogger,\n\t\tinfo: (msg, obj) => logger.info(obj, msg),\n\t\tdebug: (msg, obj) => logger.debug(obj, msg),\n\t\twarn: (msg, obj) => logger.warn(obj, msg),\n\t\terror: (msg, obj) => logger.error(obj, msg),\n\t\tgetSections(): string[] {\n\t\t\treturn getSectionsFromLogger(logger);\n\t\t},\n\t\twithSection(section, context) {\n\t\t\tif (this.getSections().includes(section)) return this;\n\n\t\t\treturn makeLogging({ logger: this.logger, section, context });\n\t\t},\n\t};\n}\n\n/**\n * Creates a LoggingWithRecords object. It requires an actual pino logger to be sent, and optionally a section and a context. You can pass it a \"messages\" record object to use or a new one will be created.\n */\nexport function makeLoggingWithRecord(opts: {\n\tlogger: PreparedLogger;\n\tsection?: string;\n\tcontext?: PlainObject;\n\tmessages?: LoggingWithRecords[\"messages\"];\n}): LoggingWithRecords {\n\tconst logging = makeLogging(opts);\n\tconst messages = opts.messages ?? {\n\t\tinfo: [],\n\t\twarn: [],\n\t\tdebug: [],\n\t\terror: [],\n\t};\n\n\tfunction makeLogFn(logFn: LogFn, key: keyof typeof messages): LogFn {\n\t\treturn (msg, obj) => {\n\t\t\tmessages[key].push([msg, obj ?? null]);\n\t\t\treturn logFn(msg, obj);\n\t\t};\n\t}\n\n\treturn {\n\t\tmessages,\n\t\tlogger: logging.logger,\n\t\tinfo: makeLogFn(logging.info, \"info\"),\n\t\tdebug: makeLogFn(logging.debug, \"debug\"),\n\t\twarn: makeLogFn(logging.warn, \"warn\"),\n\t\terror: makeLogFn(logging.error, \"error\"),\n\t\tgetSections(): string[] {\n\t\t\treturn logging.getSections();\n\t\t},\n\t\twithSection(section, context) {\n\t\t\treturn makeLoggingWithRecord({\n\t\t\t\tlogger: this.logger,\n\t\t\t\tsection,\n\t\t\t\tmessages,\n\t\t\t\tcontext,\n\t\t\t});\n\t\t},\n\t};\n}\n\n// INTERNAL\n\nfunction loggerFor(\n\tgivenLogger: PreparedLogger,\n\tsection: string | null,\n\tcontext: PlainObject | null,\n) {\n\tif (!context && (!section || loggerHasSection(givenLogger, section))) {\n\t\treturn givenLogger;\n\t}\n\n\tconst childBindings: Record<string, PlainObjectValue> = { ...context };\n\tif (section) {\n\t\tchildBindings.logSections = [\n\t\t\t...getSectionsFromLogger(givenLogger),\n\t\t\tsection,\n\t\t];\n\t}\n\n\treturn givenLogger.child(childBindings);\n}\n\nfunction getSectionsFromLogger(logger: PreparedLogger) {\n\treturn logger.bindings().logSections ?? [];\n}\n\nfunction loggerHasSection(logger: PreparedLogger, section: string) {\n\tconst sections = getSectionsFromLogger(logger);\n\treturn sections.includes(section);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,4BAAyB;AAEzB,kBAAqB;AAWd,IAAM,aA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ACjC;","names":["chalk"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plandek-utils/logging",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "TypeScript utils for Logging. Includes prettifying of JSON, logging utils, and colour utils.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -41,15 +41,15 @@
41
41
  "simplytyped": "^3.3.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "@plandek-utils/plain-object": "^2.0.0",
44
+ "@plandek-utils/plain-object": "^2.1.0",
45
45
  "pino": "^9.6.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@biomejs/biome": "1.9.4",
49
- "@types/node": "22.10.9",
49
+ "@types/node": "22.12.0",
50
50
  "@vitest/coverage-v8": "3.0.4",
51
51
  "biome": "0.3.3",
52
- "tsup": "8.3.5",
52
+ "tsup": "8.3.6",
53
53
  "typescript": "5.7.3",
54
54
  "vitest": "3.0.4"
55
55
  },