@bgord/bun 1.15.0 → 1.15.1
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/ab-variant-selector.service.d.ts.map +1 -1
- package/dist/ab-variant-selector.service.js +2 -3
- package/dist/ab-variant-selector.service.js.map +1 -1
- package/dist/hash-bucket.vo.d.ts.map +1 -1
- package/dist/hash-bucket.vo.js +1 -2
- package/dist/hash-bucket.vo.js.map +1 -1
- package/dist/healthcheck.handler.d.ts.map +1 -1
- package/dist/healthcheck.handler.js +1 -2
- package/dist/healthcheck.handler.js.map +1 -1
- package/dist/in-flight-requests-tracker.service.d.ts.map +1 -1
- package/dist/in-flight-requests-tracker.service.js +2 -3
- package/dist/in-flight-requests-tracker.service.js.map +1 -1
- package/dist/redactor-error-cause-depth-limit.strategy.d.ts.map +1 -1
- package/dist/redactor-error-cause-depth-limit.strategy.js +2 -3
- package/dist/redactor-error-cause-depth-limit.strategy.js.map +1 -1
- package/dist/redactor-metadata-compact-array.strategy.d.ts.map +1 -1
- package/dist/redactor-metadata-compact-array.strategy.js +1 -2
- package/dist/redactor-metadata-compact-array.strategy.js.map +1 -1
- package/dist/redactor-metadata-compact-object.strategy.d.ts.map +1 -1
- package/dist/redactor-metadata-compact-object.strategy.js +1 -2
- package/dist/redactor-metadata-compact-object.strategy.js.map +1 -1
- package/dist/retry.service.d.ts.map +1 -1
- package/dist/retry.service.js +1 -2
- package/dist/retry.service.js.map +1 -1
- package/dist/security-rule-violation-threshold.strategy.js +1 -1
- package/dist/security-rule-violation-threshold.strategy.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/woodchopper-dispatcher-async.strategy.d.ts.map +1 -1
- package/dist/woodchopper-dispatcher-async.strategy.js +2 -3
- package/dist/woodchopper-dispatcher-async.strategy.js.map +1 -1
- package/dist/woodchopper.d.ts.map +1 -1
- package/dist/woodchopper.js +7 -8
- package/dist/woodchopper.js.map +1 -1
- package/package.json +2 -2
- package/src/ab-variant-selector.service.ts +2 -3
- package/src/hash-bucket.vo.ts +1 -2
- package/src/healthcheck.handler.ts +1 -2
- package/src/in-flight-requests-tracker.service.ts +2 -3
- package/src/redactor-error-cause-depth-limit.strategy.ts +2 -3
- package/src/redactor-metadata-compact-array.strategy.ts +1 -2
- package/src/redactor-metadata-compact-object.strategy.ts +1 -2
- package/src/retry.service.ts +1 -3
- package/src/security-rule-violation-threshold.strategy.ts +1 -1
- package/src/woodchopper-dispatcher-async.strategy.ts +2 -3
- package/src/woodchopper.ts +7 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"woodchopper-dispatcher-async.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-dispatcher-async.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"woodchopper-dispatcher-async.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-dispatcher-async.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAO3E,eAAO,MAAM,+BAA+B;uCACP,KAAK,CAAC,mBAAmB;CAE7D,CAAC;AAEF,qBAAa,0BAA2B,YAAW,qBAAqB;IASpE,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAT3B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAEnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0B;IACjD,OAAO,CAAC,KAAK,CAA2C;IAExD,OAAO,CAAC,IAAI,CAAC,CAAa;gBAGP,IAAI,EAAE,uBAAuB,EAC7B,QAAQ,GAAE,KAAK,CAAC,mBAA6C;IAKhF,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;IAWrC,KAAK,IAAI,IAAI;YAqBC,GAAG;YAoBH,YAAY;YAKZ,YAAY;CAK3B"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import * as v from "valibot";
|
|
3
2
|
var WoodchopperDispatcherAsyncState;
|
|
4
3
|
(function (WoodchopperDispatcherAsyncState) {
|
|
5
4
|
WoodchopperDispatcherAsyncState["running"] = "running";
|
|
@@ -15,7 +14,7 @@ export class WoodchopperDispatcherAsync {
|
|
|
15
14
|
buffer = [];
|
|
16
15
|
state = WoodchopperDispatcherAsyncState.running;
|
|
17
16
|
wake;
|
|
18
|
-
constructor(sink, capacity =
|
|
17
|
+
constructor(sink, capacity = tools.Int.positive(256)) {
|
|
19
18
|
this.sink = sink;
|
|
20
19
|
this.capacity = capacity;
|
|
21
20
|
this.run();
|
|
@@ -36,7 +35,7 @@ export class WoodchopperDispatcherAsync {
|
|
|
36
35
|
// Stryker restore all
|
|
37
36
|
this.state = WoodchopperDispatcherAsyncState.closed;
|
|
38
37
|
if (this.buffer.length > 0) {
|
|
39
|
-
const message = WoodchopperDispatcherAsyncError.ClosedWithBufferedEntries(
|
|
38
|
+
const message = WoodchopperDispatcherAsyncError.ClosedWithBufferedEntries(tools.Int.positive(this.buffer.length));
|
|
40
39
|
this.onError?.(new Error(message));
|
|
41
40
|
}
|
|
42
41
|
this.buffer.length = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"woodchopper-dispatcher-async.strategy.js","sourceRoot":"","sources":["../src/woodchopper-dispatcher-async.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"woodchopper-dispatcher-async.strategy.js","sourceRoot":"","sources":["../src/woodchopper-dispatcher-async.strategy.ts"],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U,CAAC,MAAM,CAAC,CAAiD;IACzE,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAiD;IACzE,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAiD;IACzE,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAoD;IAClF,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,CAAkD;IAC5E,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,CAAkD;IAE5E,KAAK;IAOL,QAAQ,IAAI,mBAAmB;CAGhC"}
|
package/dist/woodchopper.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import * as v from "valibot";
|
|
3
2
|
import { ErrorNormalizer } from "./error-normalizer.service";
|
|
4
3
|
import { LogLevelEnum, } from "./logger.port";
|
|
5
4
|
import { LoggerState, } from "./logger-stats-provider.port";
|
|
6
5
|
import { WoodchopperStats } from "./woodchopper-stats.service";
|
|
7
6
|
const LOG_LEVEL_PRIORITY = {
|
|
8
|
-
[LogLevelEnum.error]:
|
|
9
|
-
[LogLevelEnum.warn]:
|
|
10
|
-
[LogLevelEnum.info]:
|
|
11
|
-
[LogLevelEnum.http]:
|
|
12
|
-
[LogLevelEnum.verbose]:
|
|
13
|
-
[LogLevelEnum.debug]:
|
|
14
|
-
[LogLevelEnum.silly]:
|
|
7
|
+
[LogLevelEnum.error]: tools.Int.nonNegative(0),
|
|
8
|
+
[LogLevelEnum.warn]: tools.Int.nonNegative(1),
|
|
9
|
+
[LogLevelEnum.info]: tools.Int.nonNegative(2),
|
|
10
|
+
[LogLevelEnum.http]: tools.Int.nonNegative(3),
|
|
11
|
+
[LogLevelEnum.verbose]: tools.Int.nonNegative(4),
|
|
12
|
+
[LogLevelEnum.debug]: tools.Int.nonNegative(5),
|
|
13
|
+
[LogLevelEnum.silly]: tools.Int.nonNegative(6),
|
|
15
14
|
};
|
|
16
15
|
export class Woodchopper {
|
|
17
16
|
config;
|
package/dist/woodchopper.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"woodchopper.js","sourceRoot":"","sources":["../src/woodchopper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"woodchopper.js","sourceRoot":"","sources":["../src/woodchopper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAML,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,WAAW,GAGZ,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAa/D,MAAM,kBAAkB,GAAuD;IAC7E,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;IAC9C,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7C,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7C,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7C,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;IAChD,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;IAC9C,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;CAC/C,CAAC;AAEF,MAAM,OAAO,WAAW;IAKH;IACA;IALX,KAAK,CAAc;IACV,KAAK,GAAG,IA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": "1.15.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Bartosz Gordon",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"yazl": "3.3.1"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@bgord/tools": "1.4.
|
|
46
|
+
"@bgord/tools": "1.4.2",
|
|
47
47
|
"emittery": "2.0.0",
|
|
48
48
|
"hono": "4.12.8",
|
|
49
49
|
"node-cache": "5.1.2"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import * as v from "valibot";
|
|
3
2
|
import type { AbVariant } from "./ab-variant.vo";
|
|
4
3
|
import type { AbVariants } from "./ab-variants.vo";
|
|
5
4
|
import type { Hash } from "./hash.vo";
|
|
@@ -15,10 +14,10 @@ export class AbVariantSelector {
|
|
|
15
14
|
select(hash: Hash): AbVariant {
|
|
16
15
|
const bucket = HashBucket.fromHash(hash);
|
|
17
16
|
|
|
18
|
-
let cumulative =
|
|
17
|
+
let cumulative = tools.Int.nonNegative(0);
|
|
19
18
|
|
|
20
19
|
for (const variant of this.variants.variants) {
|
|
21
|
-
cumulative =
|
|
20
|
+
cumulative = tools.Int.nonNegative(cumulative + variant.config.weight);
|
|
22
21
|
|
|
23
22
|
if (bucket.isLessThan(cumulative)) return variant;
|
|
24
23
|
}
|
package/src/hash-bucket.vo.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import * as v from "valibot";
|
|
3
2
|
import type { Hash } from "./hash.vo";
|
|
4
3
|
|
|
5
4
|
export class HashBucket {
|
|
@@ -11,7 +10,7 @@ export class HashBucket {
|
|
|
11
10
|
|
|
12
11
|
const bucket = integer % 100;
|
|
13
12
|
|
|
14
|
-
return new HashBucket(
|
|
13
|
+
return new HashBucket(tools.Int.nonNegative(bucket));
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
isLessThan(threshold: tools.IntegerNonNegativeType): boolean {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import os from "node:os";
|
|
2
2
|
import * as tools from "@bgord/tools";
|
|
3
|
-
import * as v from "valibot";
|
|
4
3
|
import type { BuildInfoRepositoryStrategy } from "./build-info-repository.strategy";
|
|
5
4
|
import type { ClockPort } from "./clock.port";
|
|
6
5
|
import type { CommitShaValueType } from "./commit-sha-value.vo";
|
|
@@ -121,7 +120,7 @@ export class HealthcheckHandler {
|
|
|
121
120
|
server: {
|
|
122
121
|
pid: process.pid,
|
|
123
122
|
hostname: os.hostname(),
|
|
124
|
-
cpus:
|
|
123
|
+
cpus: tools.Int.nonNegative(os.cpus().length),
|
|
125
124
|
startup: this.deps.Clock.now().subtract(uptime.duration).ms,
|
|
126
125
|
uptime: { ms: uptime.duration.ms, formatted: uptime.formatted },
|
|
127
126
|
memory: {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import * as v from "valibot";
|
|
3
2
|
|
|
4
3
|
export class InFlightRequestsTracker {
|
|
5
|
-
private static count: tools.IntegerType =
|
|
4
|
+
private static count: tools.IntegerType = tools.Int.of(0);
|
|
6
5
|
|
|
7
6
|
static increment(): void {
|
|
8
7
|
InFlightRequestsTracker.count++;
|
|
@@ -18,6 +17,6 @@ export class InFlightRequestsTracker {
|
|
|
18
17
|
|
|
19
18
|
/** @internal */
|
|
20
19
|
static _resetForTest(): void {
|
|
21
|
-
InFlightRequestsTracker.count =
|
|
20
|
+
InFlightRequestsTracker.count = tools.Int.of(0);
|
|
22
21
|
}
|
|
23
22
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import * as v from "valibot";
|
|
3
2
|
import { ErrorNormalizer, type NormalizedError } from "./error-normalizer.service";
|
|
4
3
|
import { isPlainObject } from "./is-plain-object";
|
|
5
4
|
import type { RedactorStrategy } from "./redactor.strategy";
|
|
@@ -13,11 +12,11 @@ export class RedactorErrorCauseDepthLimit implements RedactorStrategy {
|
|
|
13
12
|
// Stryker restore all
|
|
14
13
|
if (!ErrorNormalizer.isNormalizedError(input.error)) return input;
|
|
15
14
|
|
|
16
|
-
return { ...input, error: this.limit(input.error,
|
|
15
|
+
return { ...input, error: this.limit(input.error, tools.Int.nonNegative(0)) };
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
private limit(error: NormalizedError, depth: tools.IntegerNonNegativeType): NormalizedError {
|
|
20
19
|
if (!error.cause || depth >= this.max) return { ...error, cause: undefined };
|
|
21
|
-
return { ...error, cause: this.limit(error.cause,
|
|
20
|
+
return { ...error, cause: this.limit(error.cause, tools.Int.nonNegative(depth + 1)) };
|
|
22
21
|
}
|
|
23
22
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import * as v from "valibot";
|
|
3
2
|
import { deepCloneWith } from "./deep-clone-with";
|
|
4
3
|
import { isPlainObject } from "./is-plain-object";
|
|
5
4
|
import type { RedactorStrategy } from "./redactor.strategy";
|
|
@@ -7,7 +6,7 @@ import type { RedactorStrategy } from "./redactor.strategy";
|
|
|
7
6
|
type RedactorMetadataCompactArrayOptions = { maxItems?: tools.IntegerPositiveType };
|
|
8
7
|
|
|
9
8
|
export class RedactorMetadataCompactArray implements RedactorStrategy {
|
|
10
|
-
private static readonly DEFAULT_MAX_ITEMS =
|
|
9
|
+
private static readonly DEFAULT_MAX_ITEMS = tools.Int.positive(20);
|
|
11
10
|
|
|
12
11
|
private readonly maxItems: tools.IntegerPositiveType;
|
|
13
12
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import * as v from "valibot";
|
|
3
2
|
import { deepCloneWith } from "./deep-clone-with";
|
|
4
3
|
import { isPlainObject } from "./is-plain-object";
|
|
5
4
|
import type { RedactorStrategy } from "./redactor.strategy";
|
|
@@ -7,7 +6,7 @@ import type { RedactorStrategy } from "./redactor.strategy";
|
|
|
7
6
|
type RedactorMetadataCompactObjectOptions = { maxKeys?: tools.IntegerPositiveType };
|
|
8
7
|
|
|
9
8
|
export class RedactorMetadataCompactObject implements RedactorStrategy {
|
|
10
|
-
private static readonly DEFAULT_MAX_KEYS =
|
|
9
|
+
private static readonly DEFAULT_MAX_KEYS = tools.Int.positive(20);
|
|
11
10
|
|
|
12
11
|
private readonly maxKeys: tools.IntegerPositiveType;
|
|
13
12
|
|
package/src/retry.service.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import * as v from "valibot";
|
|
3
2
|
import type { RetryBackoffStrategy } from "./retry-backoff.strategy";
|
|
4
3
|
import type { SleeperPort } from "./sleeper.port";
|
|
5
4
|
|
|
@@ -28,8 +27,7 @@ export class Retry {
|
|
|
28
27
|
lastError = error;
|
|
29
28
|
|
|
30
29
|
if (attempt === config.max || (config.when && !config.when(error))) break;
|
|
31
|
-
|
|
32
|
-
await this.deps.Sleeper.wait(config.backoff.next(v.parse(tools.IntegerPositive, attempt)));
|
|
30
|
+
await this.deps.Sleeper.wait(config.backoff.next(tools.Int.positive(attempt)));
|
|
33
31
|
}
|
|
34
32
|
}
|
|
35
33
|
|
|
@@ -36,7 +36,7 @@ export class SecurityRuleViolationThresholdStrategy implements SecurityRuleStrat
|
|
|
36
36
|
|
|
37
37
|
await this.deps.CacheRepository.set<tools.IntegerNonNegativeType>(
|
|
38
38
|
subject.hex,
|
|
39
|
-
|
|
39
|
+
tools.Int.nonNegative(count + 1),
|
|
40
40
|
);
|
|
41
41
|
|
|
42
42
|
if (count + 1 >= this.config.threshold) return true;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import * as v from "valibot";
|
|
3
2
|
import type { LoggerEntry } from "./logger.port";
|
|
4
3
|
import type { WoodchopperDispatcher } from "./woodchopper-dispatcher.strategy";
|
|
5
4
|
import type { WoodchopperSinkStrategy } from "./woodchopper-sink.strategy";
|
|
@@ -24,7 +23,7 @@ export class WoodchopperDispatcherAsync implements WoodchopperDispatcher {
|
|
|
24
23
|
|
|
25
24
|
constructor(
|
|
26
25
|
private readonly sink: WoodchopperSinkStrategy,
|
|
27
|
-
private readonly capacity: tools.IntegerPositiveType =
|
|
26
|
+
private readonly capacity: tools.IntegerPositiveType = tools.Int.positive(256),
|
|
28
27
|
) {
|
|
29
28
|
this.run();
|
|
30
29
|
}
|
|
@@ -49,7 +48,7 @@ export class WoodchopperDispatcherAsync implements WoodchopperDispatcher {
|
|
|
49
48
|
|
|
50
49
|
if (this.buffer.length > 0) {
|
|
51
50
|
const message = WoodchopperDispatcherAsyncError.ClosedWithBufferedEntries(
|
|
52
|
-
|
|
51
|
+
tools.Int.positive(this.buffer.length),
|
|
53
52
|
);
|
|
54
53
|
|
|
55
54
|
this.onError?.(new Error(message));
|
package/src/woodchopper.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import * as v from "valibot";
|
|
3
2
|
import type { ClockPort } from "./clock.port";
|
|
4
3
|
import { ErrorNormalizer } from "./error-normalizer.service";
|
|
5
4
|
import {
|
|
@@ -33,13 +32,13 @@ export type WoodchopperConfig = {
|
|
|
33
32
|
type Dependencies = { Clock: ClockPort };
|
|
34
33
|
|
|
35
34
|
const LOG_LEVEL_PRIORITY: Record<LogLevelEnum, tools.IntegerNonNegativeType> = {
|
|
36
|
-
[LogLevelEnum.error]:
|
|
37
|
-
[LogLevelEnum.warn]:
|
|
38
|
-
[LogLevelEnum.info]:
|
|
39
|
-
[LogLevelEnum.http]:
|
|
40
|
-
[LogLevelEnum.verbose]:
|
|
41
|
-
[LogLevelEnum.debug]:
|
|
42
|
-
[LogLevelEnum.silly]:
|
|
35
|
+
[LogLevelEnum.error]: tools.Int.nonNegative(0),
|
|
36
|
+
[LogLevelEnum.warn]: tools.Int.nonNegative(1),
|
|
37
|
+
[LogLevelEnum.info]: tools.Int.nonNegative(2),
|
|
38
|
+
[LogLevelEnum.http]: tools.Int.nonNegative(3),
|
|
39
|
+
[LogLevelEnum.verbose]: tools.Int.nonNegative(4),
|
|
40
|
+
[LogLevelEnum.debug]: tools.Int.nonNegative(5),
|
|
41
|
+
[LogLevelEnum.silly]: tools.Int.nonNegative(6),
|
|
43
42
|
};
|
|
44
43
|
|
|
45
44
|
export class Woodchopper implements LoggerPort, LoggerStatsProviderPort {
|