@reliverse/relinka 1.4.2 → 1.4.4
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/README.md +15 -2
- package/bin/impl.d.ts +1 -1
- package/bin/impl.js +11 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Relinka: Logging that Actually Feels Good
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **@reliverse/relinka** is a modern, minimal logging library that actually *feels* right. It's not just pretty output — it's a system: smart formatting, file-safe logging, runtime config support, and a `fatal` mode built for developers who care about correctness. Whether you're building CLI tools, SDKs, or full-stack apps — Relinka helps you log with intention.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[sponsor](https://github.com/sponsors/blefnk) — [discord](https://discord.gg/Pb8uKbwpsJ) — [repo](https://github.com/reliverse/relinka) — [npm](https://npmjs.com/@reliverse/relinka)
|
|
6
6
|
|
|
7
7
|
## Why Relinka
|
|
8
8
|
|
|
@@ -25,6 +25,13 @@ Make sure you have git, node.js, and bun/pnpm/yarn/npm installed.
|
|
|
25
25
|
bun add @reliverse/relinka
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
**Coming soon**:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
bun i -g @reliverse/dler
|
|
32
|
+
dler relinka --console-to-relinka
|
|
33
|
+
```
|
|
34
|
+
|
|
28
35
|
### 2. Use It
|
|
29
36
|
|
|
30
37
|
#### Direct Method (Recommended)
|
|
@@ -70,6 +77,12 @@ export async function main() {
|
|
|
70
77
|
"error", // non-fatal issue level can be recovered
|
|
71
78
|
"Uh oh, something broke",
|
|
72
79
|
);
|
|
80
|
+
|
|
81
|
+
relinka(
|
|
82
|
+
"null",
|
|
83
|
+
"'null' level has a special handling case: no symbol or spacing",
|
|
84
|
+
);
|
|
85
|
+
|
|
73
86
|
// relinka(
|
|
74
87
|
// "fatal",
|
|
75
88
|
// "We should never reach this code! This should never happen! (see <anonymous> line)",
|
package/bin/impl.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export type LogLevelConfig = {
|
|
|
34
34
|
/** Configuration for all log levels. */
|
|
35
35
|
export type LogLevelsConfig = Partial<Record<LogLevel, LogLevelConfig>>;
|
|
36
36
|
/** Log level types used by the logger. */
|
|
37
|
-
export type LogLevel = "error" | "fatal" | "info" | "success" | "verbose" | "warn" | "log";
|
|
37
|
+
export type LogLevel = "error" | "fatal" | "info" | "success" | "verbose" | "warn" | "log" | "null";
|
|
38
38
|
/**
|
|
39
39
|
* Configuration options for the Relinka logger.
|
|
40
40
|
* All properties are optional to allow for partial configuration.
|
package/bin/impl.js
CHANGED
|
@@ -67,7 +67,8 @@ const DEFAULT_RELINKA_CONFIG = {
|
|
|
67
67
|
color: "gray",
|
|
68
68
|
spacing: 3
|
|
69
69
|
},
|
|
70
|
-
log: { symbol: "\u2502", fallbackSymbol: "|", color: "dim", spacing: 3 }
|
|
70
|
+
log: { symbol: "\u2502", fallbackSymbol: "|", color: "dim", spacing: 3 },
|
|
71
|
+
null: { symbol: "", fallbackSymbol: "", color: "dim", spacing: 0 }
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
74
|
function isUnicodeSupported() {
|
|
@@ -230,6 +231,13 @@ function getLevelStyle(config, level) {
|
|
|
230
231
|
spacing: 3
|
|
231
232
|
};
|
|
232
233
|
}
|
|
234
|
+
if (level === "null") {
|
|
235
|
+
return {
|
|
236
|
+
symbol: "",
|
|
237
|
+
color: levelConfig.color,
|
|
238
|
+
spacing: 0
|
|
239
|
+
};
|
|
240
|
+
}
|
|
233
241
|
const { symbol, fallbackSymbol, color, spacing } = levelConfig;
|
|
234
242
|
const effectiveSymbol = isUnicodeSupported() ? symbol : fallbackSymbol || `[${level.toUpperCase()}]`;
|
|
235
243
|
return {
|
|
@@ -268,7 +276,8 @@ const consoleMethodMap = {
|
|
|
268
276
|
info: console.info,
|
|
269
277
|
success: console.log,
|
|
270
278
|
verbose: console.log,
|
|
271
|
-
log: console.log
|
|
279
|
+
log: console.log,
|
|
280
|
+
null: console.log
|
|
272
281
|
};
|
|
273
282
|
function logToConsole(config, level, formattedMessage) {
|
|
274
283
|
if (!isColorEnabled(config)) {
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"name": "@reliverse/relinka",
|
|
17
17
|
"type": "module",
|
|
18
|
-
"version": "1.4.
|
|
18
|
+
"version": "1.4.4",
|
|
19
19
|
"keywords": [
|
|
20
20
|
"logger",
|
|
21
21
|
"consola",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
41
41
|
"@types/bun": "^1.2.13",
|
|
42
42
|
"@types/fs-extra": "^11.0.4",
|
|
43
|
-
"@types/node": "^22.15.
|
|
43
|
+
"@types/node": "^22.15.18",
|
|
44
44
|
"@types/sentencer": "^0.2.3",
|
|
45
45
|
"eslint": "^9.26.0",
|
|
46
46
|
"eslint-plugin-no-relative-import-paths": "^1.6.1",
|
|
47
47
|
"eslint-plugin-perfectionist": "^4.13.0",
|
|
48
48
|
"jiti": "^2.4.2",
|
|
49
|
-
"knip": "^5.
|
|
49
|
+
"knip": "^5.56.0",
|
|
50
50
|
"sentencer": "^0.2.1",
|
|
51
51
|
"tsx": "^4.19.4",
|
|
52
52
|
"typescript": "^5.8.3",
|