@thi.ng/rstream-log 5.0.5 → 5.0.6

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-02-22T11:59:16Z
3
+ - **Last updated**: 2024-02-25T14:07:53Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/README.md CHANGED
@@ -83,7 +83,7 @@ For Node.js REPL:
83
83
  const rstreamLog = await import("@thi.ng/rstream-log");
84
84
  ```
85
85
 
86
- Package sizes (brotli'd, pre-treeshake): ESM: 715 bytes
86
+ Package sizes (brotli'd, pre-treeshake): ESM: 750 bytes
87
87
 
88
88
  ## Dependencies
89
89
 
package/format.d.ts CHANGED
@@ -12,6 +12,10 @@ export declare const formatString: (dtFmt?: DateFormat, bodyFmt?: BodyFormat) =>
12
12
  *
13
13
  * @example
14
14
  * ```ts
15
+ * import { Logger, formatString, maskSecrets, writeConsole } from "@thi.ng/rstream-log";
16
+ *
17
+ * const logger = new Logger();
18
+ *
15
19
  * logger.transform(
16
20
  * formatString(),
17
21
  * maskSecrets([/(?<=[A-Z0-9_]\=)\w+/g])
package/logger.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import { ALogger } from "@thi.ng/logger/alogger";
2
2
  import { LogLevel, type ILogger, type LogEntry, type LogLevelName } from "@thi.ng/logger/api";
3
- import { Stream, type ISubscriber } from "@thi.ng/rstream";
3
+ import { type ISubscriber } from "@thi.ng/rstream/api";
4
+ import { Stream } from "@thi.ng/rstream/stream";
4
5
  export declare class Logger extends ALogger implements ISubscriber<LogEntry> {
5
6
  stream: Stream<LogEntry>;
6
- constructor(id: string, level?: LogLevel | LogLevelName, parent?: ILogger);
7
+ constructor(id?: string, level?: LogLevel | LogLevelName, parent?: ILogger);
7
8
  next(x: LogEntry): void;
8
9
  done(): void;
9
10
  error(e: Error): boolean;
package/logger.js CHANGED
@@ -2,11 +2,13 @@ import { ALogger } from "@thi.ng/logger/alogger";
2
2
  import {
3
3
  LogLevel
4
4
  } from "@thi.ng/logger/api";
5
- import { CloseMode, Stream } from "@thi.ng/rstream";
5
+ import { CloseMode } from "@thi.ng/rstream/api";
6
+ import { Stream } from "@thi.ng/rstream/stream";
7
+ import { __nextID } from "@thi.ng/rstream/idgen";
6
8
  class Logger extends ALogger {
7
9
  stream;
8
10
  constructor(id, level, parent) {
9
- super(id, level, parent);
11
+ super(id || `logger-${__nextID()}`, level, parent);
10
12
  this.stream = new Stream({
11
13
  id: this.id,
12
14
  closeOut: CloseMode.NEVER
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/rstream-log",
3
- "version": "5.0.5",
3
+ "version": "5.0.6",
4
4
  "description": "Structured, multilevel & hierarchical loggers based on @thi.ng/rstream",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -35,12 +35,12 @@
35
35
  "test": "bun test"
36
36
  },
37
37
  "dependencies": {
38
- "@thi.ng/api": "^8.9.25",
38
+ "@thi.ng/api": "^8.9.26",
39
39
  "@thi.ng/checks": "^3.5.0",
40
- "@thi.ng/logger": "^3.0.2",
41
- "@thi.ng/rstream": "^8.3.7",
42
- "@thi.ng/strings": "^3.7.16",
43
- "@thi.ng/transducers": "^8.9.6"
40
+ "@thi.ng/logger": "^3.0.3",
41
+ "@thi.ng/rstream": "^8.3.8",
42
+ "@thi.ng/strings": "^3.7.17",
43
+ "@thi.ng/transducers": "^8.9.7"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@microsoft/api-extractor": "^7.40.1",
@@ -97,5 +97,5 @@
97
97
  ],
98
98
  "year": 2017
99
99
  },
100
- "gitHead": "16f2b92b5410bd35dcde6c2971c8e62783ebc472\n"
100
+ "gitHead": "6e20f80dd9df1c8055ffa3c1e4d6f7598add0c0b\n"
101
101
  }