@reliverse/relinka 1.4.5 → 1.4.7
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/bin/impl.d.ts +1 -1
- package/bin/impl.js +8 -2
- package/bin/mod.d.ts +0 -22
- package/bin/mod.js +0 -50
- package/package.json +17 -17
- package/bin/deprecated/components/levels/levels.d.ts +0 -13
- package/bin/deprecated/components/levels/levels.js +0 -68
- package/bin/deprecated/components/modes/basic.d.ts +0 -19
- package/bin/deprecated/components/modes/basic.js +0 -20
- package/bin/deprecated/components/modes/browser.d.ts +0 -19
- package/bin/deprecated/components/modes/browser.js +0 -13
- package/bin/deprecated/components/modes/shared.d.ts +0 -2
- package/bin/deprecated/components/modes/shared.js +0 -1
- package/bin/deprecated/components/relinka-deprecated/logger.d.ts +0 -5
- package/bin/deprecated/components/relinka-deprecated/logger.js +0 -5
- package/bin/deprecated/components/relinka-deprecated/mod.d.ts +0 -20
- package/bin/deprecated/components/relinka-deprecated/mod.js +0 -33
- package/bin/deprecated/components/relinka-deprecated/relinka.d.ts +0 -140
- package/bin/deprecated/components/relinka-deprecated/relinka.js +0 -381
- package/bin/deprecated/components/reporters/basic.d.ts +0 -11
- package/bin/deprecated/components/reporters/basic.js +0 -53
- package/bin/deprecated/components/reporters/browser.d.ts +0 -10
- package/bin/deprecated/components/reporters/browser.js +0 -56
- package/bin/deprecated/components/reporters/fancy.d.ts +0 -10
- package/bin/deprecated/components/reporters/fancy.js +0 -104
- package/bin/deprecated/impl-old.d.ts +0 -0
- package/bin/deprecated/impl-old.js +0 -0
- package/bin/deprecated/types.d.ts +0 -161
- package/bin/deprecated/types.js +0 -0
- package/bin/deprecated/utils/box.d.ts +0 -114
- package/bin/deprecated/utils/box.js +0 -145
- package/bin/deprecated/utils/deprecatedColors.d.ts +0 -69
- package/bin/deprecated/utils/deprecatedColors.js +0 -78
- package/bin/deprecated/utils/error.d.ts +0 -6
- package/bin/deprecated/utils/error.js +0 -6
- package/bin/deprecated/utils/format-new.d.ts +0 -15
- package/bin/deprecated/utils/format-new.js +0 -13
- package/bin/deprecated/utils/format.d.ts +0 -14
- package/bin/deprecated/utils/format.js +0 -26
- package/bin/deprecated/utils/log.d.ts +0 -13
- package/bin/deprecated/utils/log.js +0 -15
- package/bin/deprecated/utils/stream.d.ts +0 -14
- package/bin/deprecated/utils/stream.js +0 -4
- package/bin/deprecated/utils/string.d.ts +0 -50
- package/bin/deprecated/utils/string.js +0 -53
- package/bin/deprecated/utils/tree.d.ts +0 -41
- package/bin/deprecated/utils/tree.js +0 -37
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" | "null";
|
|
37
|
+
export type LogLevel = "error" | "fatal" | "info" | "success" | "verbose" | "warn" | "log" | "internal" | "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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import path from "@reliverse/pathkit";
|
|
1
2
|
import { re } from "@reliverse/relico";
|
|
3
|
+
import fs from "@reliverse/relifso";
|
|
2
4
|
import { loadConfig } from "c12";
|
|
3
|
-
import fs from "fs-extra";
|
|
4
5
|
import os from "node:os";
|
|
5
|
-
import path from "pathe";
|
|
6
6
|
const ENABLE_DEV_DEBUG = false;
|
|
7
7
|
const EXIT_GUARD = Symbol.for("relinka.exitHandlersRegistered");
|
|
8
8
|
const DEFAULT_RELINKA_CONFIG = {
|
|
@@ -67,6 +67,12 @@ const DEFAULT_RELINKA_CONFIG = {
|
|
|
67
67
|
color: "gray",
|
|
68
68
|
spacing: 3
|
|
69
69
|
},
|
|
70
|
+
internal: {
|
|
71
|
+
symbol: "\u2699",
|
|
72
|
+
fallbackSymbol: "[INTERNAL]",
|
|
73
|
+
color: "magentaBright",
|
|
74
|
+
spacing: 3
|
|
75
|
+
},
|
|
70
76
|
log: { symbol: "\u2502", fallbackSymbol: "|", color: "dim", spacing: 3 },
|
|
71
77
|
null: { symbol: "", fallbackSymbol: "", color: "dim", spacing: 0 }
|
|
72
78
|
}
|
package/bin/mod.d.ts
CHANGED
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
export * from "./deprecated/types.js";
|
|
2
|
-
export { LogLevelsDeprecated, LogTypesDeprecated, } from "./deprecated/components/levels/levels.js";
|
|
3
|
-
export { createRelinkaBaseDeprecated, relinkaBasicDeprecated, } from "./deprecated/components/modes/basic.js";
|
|
4
|
-
export { createRelinkaBrowserDeprecatedDeprecated, relinkaBrowserDeprecated, } from "./deprecated/components/modes/browser.js";
|
|
5
|
-
export { relinkaDeprecated } from "./deprecated/components/relinka-deprecated/logger.js";
|
|
6
|
-
export { createRelinkaSharedDeprecated, relinkaInstanceDeprecated, } from "./deprecated/components/relinka-deprecated/mod.js";
|
|
7
|
-
export type { LogFn, RelinkaInstanceDeprecated, } from "./deprecated/components/relinka-deprecated/relinka.js";
|
|
8
|
-
export { RelinkaInterface, createRelinkaDeprecated, } from "./deprecated/components/relinka-deprecated/relinka.js";
|
|
9
|
-
export { BasicReporter } from "./deprecated/components/reporters/basic.js";
|
|
10
|
-
export { BrowserReporter } from "./deprecated/components/reporters/browser.js";
|
|
11
|
-
export { TYPE_COLOR_MAP, LEVEL_COLOR_MAP, FancyReporter, } from "./deprecated/components/reporters/fancy.js";
|
|
12
|
-
export type { BoxBorderStyle, BoxStyle, BoxOpts, } from "./deprecated/utils/box.js";
|
|
13
|
-
export { box } from "./deprecated/utils/box.js";
|
|
14
|
-
export type { ColorName, ColorFunction, } from "./deprecated/utils/deprecatedColors.js";
|
|
15
|
-
export { colors, getColor, colorize, } from "./deprecated/utils/deprecatedColors.js";
|
|
16
|
-
export { parseStack } from "./deprecated/utils/error.js";
|
|
17
|
-
export { compileFormatCompat, formatStringCompat, } from "./deprecated/utils/format.js";
|
|
18
|
-
export { isPlainObject, isLogObj } from "./deprecated/utils/log.js";
|
|
19
|
-
export { writeStream } from "./deprecated/utils/stream.js";
|
|
20
|
-
export { stripAnsi, centerAlign, rightAlign, leftAlign, align, } from "./deprecated/utils/string.js";
|
|
21
|
-
export type { TreeItemObject, TreeItem, TreeOptions, } from "./deprecated/utils/tree.js";
|
|
22
|
-
export { formatTree } from "./deprecated/utils/tree.js";
|
|
23
1
|
export type { RelinkaSpecialDirsConfig, RelinkaDirsConfig, LogLevelConfig, LogLevelsConfig, LogLevel, RelinkaConfig, LogFileInfo, } from "./impl.js";
|
|
24
2
|
export { relinkaConfig, relinkaShutdown, flushAllLogBuffers, shouldNeverHappen, truncateString, casesHandled, relinka, relinkaAsync, defineConfig, } from "./impl.js";
|
package/bin/mod.js
CHANGED
|
@@ -1,53 +1,3 @@
|
|
|
1
|
-
export * from "./deprecated/types.js";
|
|
2
|
-
export {
|
|
3
|
-
LogLevelsDeprecated,
|
|
4
|
-
LogTypesDeprecated
|
|
5
|
-
} from "./deprecated/components/levels/levels.js";
|
|
6
|
-
export {
|
|
7
|
-
createRelinkaBaseDeprecated,
|
|
8
|
-
relinkaBasicDeprecated
|
|
9
|
-
} from "./deprecated/components/modes/basic.js";
|
|
10
|
-
export {
|
|
11
|
-
createRelinkaBrowserDeprecatedDeprecated,
|
|
12
|
-
relinkaBrowserDeprecated
|
|
13
|
-
} from "./deprecated/components/modes/browser.js";
|
|
14
|
-
export { relinkaDeprecated } from "./deprecated/components/relinka-deprecated/logger.js";
|
|
15
|
-
export {
|
|
16
|
-
createRelinkaSharedDeprecated,
|
|
17
|
-
relinkaInstanceDeprecated
|
|
18
|
-
} from "./deprecated/components/relinka-deprecated/mod.js";
|
|
19
|
-
export {
|
|
20
|
-
RelinkaInterface,
|
|
21
|
-
createRelinkaDeprecated
|
|
22
|
-
} from "./deprecated/components/relinka-deprecated/relinka.js";
|
|
23
|
-
export { BasicReporter } from "./deprecated/components/reporters/basic.js";
|
|
24
|
-
export { BrowserReporter } from "./deprecated/components/reporters/browser.js";
|
|
25
|
-
export {
|
|
26
|
-
TYPE_COLOR_MAP,
|
|
27
|
-
LEVEL_COLOR_MAP,
|
|
28
|
-
FancyReporter
|
|
29
|
-
} from "./deprecated/components/reporters/fancy.js";
|
|
30
|
-
export { box } from "./deprecated/utils/box.js";
|
|
31
|
-
export {
|
|
32
|
-
colors,
|
|
33
|
-
getColor,
|
|
34
|
-
colorize
|
|
35
|
-
} from "./deprecated/utils/deprecatedColors.js";
|
|
36
|
-
export { parseStack } from "./deprecated/utils/error.js";
|
|
37
|
-
export {
|
|
38
|
-
compileFormatCompat,
|
|
39
|
-
formatStringCompat
|
|
40
|
-
} from "./deprecated/utils/format.js";
|
|
41
|
-
export { isPlainObject, isLogObj } from "./deprecated/utils/log.js";
|
|
42
|
-
export { writeStream } from "./deprecated/utils/stream.js";
|
|
43
|
-
export {
|
|
44
|
-
stripAnsi,
|
|
45
|
-
centerAlign,
|
|
46
|
-
rightAlign,
|
|
47
|
-
leftAlign,
|
|
48
|
-
align
|
|
49
|
-
} from "./deprecated/utils/string.js";
|
|
50
|
-
export { formatTree } from "./deprecated/utils/tree.js";
|
|
51
1
|
export {
|
|
52
2
|
relinkaConfig,
|
|
53
3
|
relinkaShutdown,
|
package/package.json
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
+
"@reliverse/pathkit": "^1.1.5",
|
|
3
4
|
"@reliverse/relico": "^1.1.2",
|
|
4
|
-
"@reliverse/
|
|
5
|
-
"
|
|
6
|
-
"c12": "^3.0.3",
|
|
7
|
-
"defu": "^6.1.4",
|
|
8
|
-
"fs-extra": "^11.3.0",
|
|
9
|
-
"pathe": "^2.0.3",
|
|
10
|
-
"std-env": "^3.9.0",
|
|
11
|
-
"string-width": "^7.2.0"
|
|
5
|
+
"@reliverse/relifso": "^1.2.10",
|
|
6
|
+
"c12": "^3.0.4"
|
|
12
7
|
},
|
|
13
8
|
"description": "@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.",
|
|
14
9
|
"homepage": "https://docs.reliverse.org",
|
|
15
10
|
"license": "MIT",
|
|
16
11
|
"name": "@reliverse/relinka",
|
|
17
12
|
"type": "module",
|
|
18
|
-
"version": "1.4.
|
|
13
|
+
"version": "1.4.7",
|
|
19
14
|
"keywords": [
|
|
20
15
|
"logger",
|
|
21
16
|
"consola",
|
|
@@ -34,20 +29,25 @@
|
|
|
34
29
|
],
|
|
35
30
|
"devDependencies": {
|
|
36
31
|
"@biomejs/biome": "1.9.4",
|
|
37
|
-
"@eslint/js": "^9.
|
|
38
|
-
"@reliverse/
|
|
32
|
+
"@eslint/js": "^9.27.0",
|
|
33
|
+
"@reliverse/dler": "^1.4.6",
|
|
34
|
+
"@reliverse/repris": "^1.0.0",
|
|
35
|
+
"@reliverse/runtime": "^1.0.3",
|
|
39
36
|
"@stylistic/eslint-plugin": "^4.2.0",
|
|
40
37
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
41
|
-
"@types/bun": "^1.2.
|
|
42
|
-
"@types/
|
|
43
|
-
"@types/node": "^22.15.18",
|
|
38
|
+
"@types/bun": "^1.2.14",
|
|
39
|
+
"@types/node": "^22.15.21",
|
|
44
40
|
"@types/sentencer": "^0.2.3",
|
|
45
|
-
"
|
|
41
|
+
"defu": "^6.1.4",
|
|
42
|
+
"eslint": "^9.27.0",
|
|
46
43
|
"eslint-plugin-no-relative-import-paths": "^1.6.1",
|
|
47
44
|
"eslint-plugin-perfectionist": "^4.13.0",
|
|
48
45
|
"jiti": "^2.4.2",
|
|
49
|
-
"knip": "^5.
|
|
46
|
+
"knip": "^5.57.2",
|
|
47
|
+
"pathe": "^2.0.3",
|
|
50
48
|
"sentencer": "^0.2.1",
|
|
49
|
+
"std-env": "^3.9.0",
|
|
50
|
+
"string-width": "^7.2.0",
|
|
51
51
|
"tsx": "^4.19.4",
|
|
52
52
|
"typescript": "^5.8.3",
|
|
53
53
|
"typescript-eslint": "^8.32.1"
|
|
@@ -66,4 +66,4 @@
|
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
|
68
68
|
}
|
|
69
|
-
}
|
|
69
|
+
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { LogObject, LogTypeDeprecated } from "../../types.js";
|
|
2
|
-
/**
|
|
3
|
-
* A mapping of `LogTypeDeprecated` to its corresponding numeric log level.
|
|
4
|
-
*
|
|
5
|
-
* @type {Record<LogTypeDeprecated, number>} LogLevelsDeprecated - key-value pairs of log types to their numeric levels. See {@link LogTypeDeprecated}.
|
|
6
|
-
*/
|
|
7
|
-
export declare const LogLevelsDeprecated: Record<LogTypeDeprecated, number>;
|
|
8
|
-
/**
|
|
9
|
-
* Maps `LogTypeDeprecated` to a `Partial<LogObject>`, primarily defining the log level.
|
|
10
|
-
*
|
|
11
|
-
* @type {Record<LogTypeDeprecated, Partial<LogObject>>} LogTypesDeprecated - key-value pairs of log types to partial log objects, specifying log levels. See {@link LogTypeDeprecated} and {@link LogObject}.
|
|
12
|
-
*/
|
|
13
|
-
export declare const LogTypesDeprecated: Record<LogTypeDeprecated, Partial<LogObject>>;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
export const LogLevelsDeprecated = {
|
|
2
|
-
silent: Number.NEGATIVE_INFINITY,
|
|
3
|
-
fatal: 0,
|
|
4
|
-
error: 0,
|
|
5
|
-
warn: 1,
|
|
6
|
-
log: 2,
|
|
7
|
-
info: 3,
|
|
8
|
-
success: 3,
|
|
9
|
-
fail: 3,
|
|
10
|
-
ready: 3,
|
|
11
|
-
start: 3,
|
|
12
|
-
box: 3,
|
|
13
|
-
debug: 4,
|
|
14
|
-
trace: 5,
|
|
15
|
-
verbose: Number.POSITIVE_INFINITY
|
|
16
|
-
};
|
|
17
|
-
export const LogTypesDeprecated = {
|
|
18
|
-
// Silent
|
|
19
|
-
silent: {
|
|
20
|
-
level: -1
|
|
21
|
-
},
|
|
22
|
-
// Level 0
|
|
23
|
-
fatal: {
|
|
24
|
-
level: LogLevelsDeprecated.fatal
|
|
25
|
-
},
|
|
26
|
-
error: {
|
|
27
|
-
level: LogLevelsDeprecated.error
|
|
28
|
-
},
|
|
29
|
-
// Level 1
|
|
30
|
-
warn: {
|
|
31
|
-
level: LogLevelsDeprecated.warn
|
|
32
|
-
},
|
|
33
|
-
// Level 2
|
|
34
|
-
log: {
|
|
35
|
-
level: LogLevelsDeprecated.log
|
|
36
|
-
},
|
|
37
|
-
// Level 3
|
|
38
|
-
info: {
|
|
39
|
-
level: LogLevelsDeprecated.info
|
|
40
|
-
},
|
|
41
|
-
success: {
|
|
42
|
-
level: LogLevelsDeprecated.success
|
|
43
|
-
},
|
|
44
|
-
fail: {
|
|
45
|
-
level: LogLevelsDeprecated.fail
|
|
46
|
-
},
|
|
47
|
-
ready: {
|
|
48
|
-
level: LogLevelsDeprecated.info
|
|
49
|
-
},
|
|
50
|
-
start: {
|
|
51
|
-
level: LogLevelsDeprecated.info
|
|
52
|
-
},
|
|
53
|
-
box: {
|
|
54
|
-
level: LogLevelsDeprecated.info
|
|
55
|
-
},
|
|
56
|
-
// Level 4
|
|
57
|
-
debug: {
|
|
58
|
-
level: LogLevelsDeprecated.debug
|
|
59
|
-
},
|
|
60
|
-
// Level 5
|
|
61
|
-
trace: {
|
|
62
|
-
level: LogLevelsDeprecated.trace
|
|
63
|
-
},
|
|
64
|
-
// Verbose
|
|
65
|
-
verbose: {
|
|
66
|
-
level: LogLevelsDeprecated.verbose
|
|
67
|
-
}
|
|
68
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { RelinkaInstanceDeprecated } from "../relinka-deprecated/relinka.js";
|
|
2
|
-
import type { RelinkaOptionsDeprecated } from "../../types.js";
|
|
3
|
-
export * from "./shared.js";
|
|
4
|
-
/**
|
|
5
|
-
* Factory function to create a new Relinka instance
|
|
6
|
-
*
|
|
7
|
-
* @param {Partial<RelinkaOptionsDeprecated & { fancy: boolean }>} [options={}] - Optional configuration options. See {@link RelinkaOptionsDeprecated}.
|
|
8
|
-
* @returns {RelinkaInstanceDeprecated} A new Relinka instance configured with the given options.
|
|
9
|
-
*/
|
|
10
|
-
export declare function createRelinkaBaseDeprecated(options?: Partial<RelinkaOptionsDeprecated & {
|
|
11
|
-
fancy: boolean;
|
|
12
|
-
}>): RelinkaInstanceDeprecated;
|
|
13
|
-
/**
|
|
14
|
-
* Creates and exports a standard instance of Relinka with the default configuration.
|
|
15
|
-
* This instance can be used directly for logging throughout the application.
|
|
16
|
-
*
|
|
17
|
-
* @type {RelinkaInstanceDeprecated} relinka - The default instance of Relinka.
|
|
18
|
-
*/
|
|
19
|
-
export declare const relinkaBasicDeprecated: RelinkaInstanceDeprecated;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { LogLevelsDeprecated } from "../levels/levels.js";
|
|
2
|
-
import { createRelinkaDeprecated as _createRelinkaDeprecated } from "../relinka-deprecated/relinka.js";
|
|
3
|
-
import { BasicReporter } from "../reporters/basic.js";
|
|
4
|
-
export * from "./shared.js";
|
|
5
|
-
export function createRelinkaBaseDeprecated(options = {}) {
|
|
6
|
-
let level = LogLevelsDeprecated.info;
|
|
7
|
-
if (process.env.RELINKA_LEVEL) {
|
|
8
|
-
level = Number.parseInt(process.env.RELINKA_LEVEL) ?? level;
|
|
9
|
-
}
|
|
10
|
-
const relinka = _createRelinkaDeprecated({
|
|
11
|
-
level,
|
|
12
|
-
defaults: { level },
|
|
13
|
-
stdout: process.stdout,
|
|
14
|
-
stderr: process.stderr,
|
|
15
|
-
reporters: options.reporters || [new BasicReporter()],
|
|
16
|
-
...options
|
|
17
|
-
});
|
|
18
|
-
return relinka;
|
|
19
|
-
}
|
|
20
|
-
export const relinkaBasicDeprecated = createRelinkaBaseDeprecated();
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { RelinkaOptionsDeprecated } from "../../types.js";
|
|
2
|
-
import { type RelinkaInstanceDeprecated } from "../relinka-deprecated/relinka.js";
|
|
3
|
-
export * from "./shared.js";
|
|
4
|
-
/**
|
|
5
|
-
* Creates a new Relinka instance configured specifically for browser environments.
|
|
6
|
-
* This function sets up default reporters and a prompt method tailored to the browser's dialogue APIs.
|
|
7
|
-
*
|
|
8
|
-
* @param {Partial<RelinkaOptionsDeprecated>} [options={}] - Optional configuration options.
|
|
9
|
-
* The options can override the default reporter and prompt behavior. See {@link RelinkaOptionsDeprecated}.
|
|
10
|
-
* @returns {RelinkaInstanceDeprecated} A new Relinka instance optimized for use in browser environments.
|
|
11
|
-
*/
|
|
12
|
-
export declare function createRelinkaBrowserDeprecatedDeprecated(options?: Partial<RelinkaOptionsDeprecated>): any;
|
|
13
|
-
/**
|
|
14
|
-
* A standard Relinka instance created with browser-specific configurations.
|
|
15
|
-
* This instance can be used throughout a browser-based project.
|
|
16
|
-
*
|
|
17
|
-
* @type {RelinkaInstanceDeprecated} relinka - The default browser-configured Relinka instance.
|
|
18
|
-
*/
|
|
19
|
-
export declare const relinkaBrowserDeprecated: RelinkaInstanceDeprecated;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createRelinkaDeprecated as _createRelinkaDeprecated
|
|
3
|
-
} from "../relinka-deprecated/relinka.js";
|
|
4
|
-
import { BrowserReporter } from "../reporters/browser.js";
|
|
5
|
-
export * from "./shared.js";
|
|
6
|
-
export function createRelinkaBrowserDeprecatedDeprecated(options = {}) {
|
|
7
|
-
const relinka = _createRelinkaDeprecated({
|
|
8
|
-
reporters: options.reporters || [new BrowserReporter({})],
|
|
9
|
-
...options
|
|
10
|
-
});
|
|
11
|
-
return relinka;
|
|
12
|
-
}
|
|
13
|
-
export const relinkaBrowserDeprecated = createRelinkaBrowserDeprecatedDeprecated();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { LogTypesDeprecated } from "../levels/levels.js";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
type MessageKind = "log" | "info" | "warn" | "error" | "success";
|
|
2
|
-
type VerboseKind = `${MessageKind}-verbose`;
|
|
3
|
-
type AllKinds = MessageKind | VerboseKind;
|
|
4
|
-
export declare const relinkaDeprecated: (_kind: AllKinds, title: string, content?: string, hint?: string) => void;
|
|
5
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { RelinkaOptionsDeprecated } from "../../types.js";
|
|
2
|
-
import type { RelinkaInstanceDeprecated } from "./relinka.js";
|
|
3
|
-
export * from "../modes/shared.js";
|
|
4
|
-
/**
|
|
5
|
-
* Factory function to create a new Relinka instance tailored for use in different environments.
|
|
6
|
-
* It automatically adjusts logging levels based on environment variables and execution context.
|
|
7
|
-
*
|
|
8
|
-
* @param {Partial<RelinkaOptionsDeprecated & { fancy: boolean }>} [options={}] - Optional configuration options. See {@link RelinkaOptionsDeprecated}.
|
|
9
|
-
* @returns {RelinkaInstanceDeprecated} A new Relinka instance with configurations based on the given options and the execution environment.
|
|
10
|
-
*/
|
|
11
|
-
export declare function createRelinkaSharedDeprecated(options?: Partial<RelinkaOptionsDeprecated & {
|
|
12
|
-
fancy: boolean;
|
|
13
|
-
}>): RelinkaInstanceDeprecated;
|
|
14
|
-
/**
|
|
15
|
-
* A default instance of Relinka, created and configured for immediate use.
|
|
16
|
-
* This instance is configured based on the execution environment and the options provided.
|
|
17
|
-
*
|
|
18
|
-
* @type {RelinkaInstanceDeprecated} relinka - The default Relinka instance, ready to use.
|
|
19
|
-
*/
|
|
20
|
-
export declare const relinkaInstanceDeprecated: RelinkaInstanceDeprecated;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { isDebug, isTest, isCI } from "std-env";
|
|
2
|
-
import { LogLevelsDeprecated } from "../levels/levels.js";
|
|
3
|
-
import { BasicReporter } from "../reporters/basic.js";
|
|
4
|
-
import { FancyReporter } from "../reporters/fancy.js";
|
|
5
|
-
import { createRelinkaDeprecated as _createRelinkaDeprecated } from "./relinka.js";
|
|
6
|
-
export * from "../modes/shared.js";
|
|
7
|
-
export function createRelinkaSharedDeprecated(options = {}) {
|
|
8
|
-
let level = _getDefaultLogLevelDeprecated();
|
|
9
|
-
if (process.env.RELINKA_LEVEL) {
|
|
10
|
-
level = Number.parseInt(process.env.RELINKA_LEVEL) ?? level;
|
|
11
|
-
}
|
|
12
|
-
const relinka = _createRelinkaDeprecated({
|
|
13
|
-
level,
|
|
14
|
-
defaults: { level },
|
|
15
|
-
stdout: process.stdout,
|
|
16
|
-
stderr: process.stderr,
|
|
17
|
-
reporters: options.reporters || [
|
|
18
|
-
options.fancy ?? !(isCI || isTest) ? new FancyReporter() : new BasicReporter()
|
|
19
|
-
],
|
|
20
|
-
...options
|
|
21
|
-
});
|
|
22
|
-
return relinka;
|
|
23
|
-
}
|
|
24
|
-
function _getDefaultLogLevelDeprecated() {
|
|
25
|
-
if (isDebug) {
|
|
26
|
-
return LogLevelsDeprecated.debug;
|
|
27
|
-
}
|
|
28
|
-
if (isTest) {
|
|
29
|
-
return LogLevelsDeprecated.warn;
|
|
30
|
-
}
|
|
31
|
-
return LogLevelsDeprecated.info;
|
|
32
|
-
}
|
|
33
|
-
export const relinkaInstanceDeprecated = createRelinkaSharedDeprecated();
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import type { LogTypeDeprecated } from "../../types.js";
|
|
2
|
-
import type { InputLogObject, LogObject, RelinkaOptionsDeprecated, RelinkaReporterDeprecated } from "../../types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Relinka class for logging management with support for pause/resume, mocking and customizable reporting.
|
|
5
|
-
* Provides flexible logging capabilities including level-based logging, custom reporters and integration options.
|
|
6
|
-
*
|
|
7
|
-
* @class Relinka
|
|
8
|
-
*/
|
|
9
|
-
export declare class RelinkaInterface {
|
|
10
|
-
options: RelinkaOptionsDeprecated;
|
|
11
|
-
_lastLog: {
|
|
12
|
-
serialized?: string;
|
|
13
|
-
object?: LogObject;
|
|
14
|
-
count?: number;
|
|
15
|
-
time?: Date;
|
|
16
|
-
timeout?: ReturnType<typeof setTimeout>;
|
|
17
|
-
};
|
|
18
|
-
_paused: boolean;
|
|
19
|
-
_queue: any[];
|
|
20
|
-
_mockFn?: RelinkaOptionsDeprecated["mockFn"];
|
|
21
|
-
/**
|
|
22
|
-
* Creates an instance of Relinka with specified options or defaults.
|
|
23
|
-
*
|
|
24
|
-
* @param {Partial<RelinkaOptionsDeprecated>} [options={}] - Configuration options for the Relinka instance.
|
|
25
|
-
*/
|
|
26
|
-
constructor(options?: Partial<RelinkaOptionsDeprecated>);
|
|
27
|
-
/**
|
|
28
|
-
* Gets the current log level of the Relinka instance.
|
|
29
|
-
*
|
|
30
|
-
* @returns {number} The current log level.
|
|
31
|
-
*/
|
|
32
|
-
get level(): any;
|
|
33
|
-
/**
|
|
34
|
-
* Sets the minimum log level that will be output by the instance.
|
|
35
|
-
*
|
|
36
|
-
* @param {number} level - The new log level to set.
|
|
37
|
-
*/
|
|
38
|
-
set level(level: any);
|
|
39
|
-
/**
|
|
40
|
-
* Creates a new instance of Relinka, inheriting options from the current instance, with possible overrides.
|
|
41
|
-
*
|
|
42
|
-
* @param {Partial<RelinkaOptionsDeprecated>} options - Optional overrides for the new instance. See {@link RelinkaOptionsDeprecated}.
|
|
43
|
-
* @returns {RelinkaInstanceDeprecated} A new Relinka instance. See {@link RelinkaInstanceDeprecated}.
|
|
44
|
-
*/
|
|
45
|
-
create(options: Partial<RelinkaOptionsDeprecated>): RelinkaInstanceDeprecated;
|
|
46
|
-
/**
|
|
47
|
-
* Creates a new Relinka instance with the specified default log object properties.
|
|
48
|
-
*
|
|
49
|
-
* @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
|
|
50
|
-
* @returns {RelinkaInstanceDeprecated} A new Relinka instance. See {@link RelinkaInstanceDeprecated}.
|
|
51
|
-
*/
|
|
52
|
-
withDefaults(defaults: InputLogObject): RelinkaInstanceDeprecated;
|
|
53
|
-
/**
|
|
54
|
-
* Creates a new Relinka instance with a specified tag, which will be included in every log.
|
|
55
|
-
*
|
|
56
|
-
* @param {string} tag - The tag to include in each log of the new instance.
|
|
57
|
-
* @returns {RelinkaInstanceDeprecated} A new Relinka instance. See {@link RelinkaInstanceDeprecated}.
|
|
58
|
-
*/
|
|
59
|
-
withTag(tag: string): RelinkaInstanceDeprecated;
|
|
60
|
-
/**
|
|
61
|
-
* Adds a custom reporter to the Relinka instance.
|
|
62
|
-
* Reporters will be called for each log message, depending on their implementation and log level.
|
|
63
|
-
*
|
|
64
|
-
* @param {RelinkaReporterDeprecated} reporter - The reporter to add. See {@link RelinkaReporterDeprecated}.
|
|
65
|
-
* @returns {Relinka} The current Relinka instance.
|
|
66
|
-
*/
|
|
67
|
-
addReporter(reporter: RelinkaReporterDeprecated): this;
|
|
68
|
-
/**
|
|
69
|
-
* Removes a custom reporter from the Relinka instance.
|
|
70
|
-
* If no reporter is specified, all reporters will be removed.
|
|
71
|
-
*
|
|
72
|
-
* @param {RelinkaReporterDeprecated} reporter - The reporter to remove. See {@link RelinkaReporterDeprecated}.
|
|
73
|
-
* @returns {Relinka} The current Relinka instance.
|
|
74
|
-
*/
|
|
75
|
-
removeReporter(reporter: RelinkaReporterDeprecated): any;
|
|
76
|
-
/**
|
|
77
|
-
* Replaces all reporters of the Relinka instance with the specified array of reporters.
|
|
78
|
-
*
|
|
79
|
-
* @param {RelinkaReporterDeprecated[]} reporters - The new reporters to set. See {@link RelinkaReporterDeprecated}.
|
|
80
|
-
* @returns {Relinka} The current Relinka instance.
|
|
81
|
-
*/
|
|
82
|
-
setReporters(reporters: RelinkaReporterDeprecated[]): this;
|
|
83
|
-
wrapAll(): void;
|
|
84
|
-
restoreAll(): void;
|
|
85
|
-
/**
|
|
86
|
-
* Overrides console methods with Relinka logging methods for consistent logging.
|
|
87
|
-
*/
|
|
88
|
-
wrapConsole(): void;
|
|
89
|
-
/**
|
|
90
|
-
* Restores the original console methods, removing Relinka overrides.
|
|
91
|
-
*/
|
|
92
|
-
restoreConsole(): void;
|
|
93
|
-
/**
|
|
94
|
-
* Overrides standard output and error streams to redirect them through RelinkaInterface.
|
|
95
|
-
*/
|
|
96
|
-
wrapStd(): void;
|
|
97
|
-
_wrapStream(stream: NodeJS.WriteStream | undefined, type: LogTypeDeprecated): void;
|
|
98
|
-
/**
|
|
99
|
-
* Restores the original standard output and error streams, removing the Relinka redirection.
|
|
100
|
-
*/
|
|
101
|
-
restoreStd(): void;
|
|
102
|
-
_restoreStream(stream?: NodeJS.WriteStream): void;
|
|
103
|
-
/**
|
|
104
|
-
* Clears the internal state of the Relinka instance.
|
|
105
|
-
* This will reset any throttling, last log data, clear any queued logs,
|
|
106
|
-
* and optionally clear the actual console.
|
|
107
|
-
*
|
|
108
|
-
* @param {boolean} clearConsole - Whether to clear the actual console. Defaults to false.
|
|
109
|
-
*/
|
|
110
|
-
clear(clearConsole?: boolean): void;
|
|
111
|
-
/**
|
|
112
|
-
* Pauses logging, queues incoming logs until resumed.
|
|
113
|
-
*/
|
|
114
|
-
pauseLogs(): void;
|
|
115
|
-
/**
|
|
116
|
-
* Resumes logging, processing any queued logs.
|
|
117
|
-
*/
|
|
118
|
-
resumeLogs(): void;
|
|
119
|
-
/**
|
|
120
|
-
* Replaces logging methods with mocks if a mock function is provided.
|
|
121
|
-
*
|
|
122
|
-
* @param {RelinkaOptionsDeprecated["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link RelinkaOptionsDeprecated["mockFn"]}.
|
|
123
|
-
*/
|
|
124
|
-
mockTypes(mockFn?: RelinkaOptionsDeprecated["mockFn"]): void;
|
|
125
|
-
_wrapLogFn(defaults: InputLogObject, isRaw?: boolean): (...args: any[]) => boolean;
|
|
126
|
-
_logFn(defaults: InputLogObject, args: any[], isRaw?: boolean): boolean;
|
|
127
|
-
_log(logObj: LogObject): void;
|
|
128
|
-
}
|
|
129
|
-
export type LogFn = {
|
|
130
|
-
(message: InputLogObject | any, ...args: any[]): void;
|
|
131
|
-
raw: (...args: any[]) => void;
|
|
132
|
-
};
|
|
133
|
-
export type RelinkaInstanceDeprecated = RelinkaInterface & Record<LogTypeDeprecated, LogFn>;
|
|
134
|
-
/**
|
|
135
|
-
* Utility for creating a new Relinka instance with optional configuration.
|
|
136
|
-
*
|
|
137
|
-
* @param {Partial<RelinkaOptionsDeprecated>} [options={}] - Optional configuration options for the new Relinka instance. See {@link RelinkaOptionsDeprecated}.
|
|
138
|
-
* @returns {RelinkaInstanceDeprecated} A new instance of RelinkaInterface. See {@link RelinkaInstanceDeprecated}.
|
|
139
|
-
*/
|
|
140
|
-
export declare function createRelinkaDeprecated(options?: Partial<RelinkaOptionsDeprecated>): RelinkaInstanceDeprecated;
|