MCPcopy Create free account
hub / github.com/axe-api/axe-api / setInstance

Method setInstance

packages/axe-api/src/Services/LogService.ts:6–35  ·  view source on GitHub ↗
(options?: logger.LoggerOptions | undefined)

Source from the content-addressed store, hash-verified

4 private static logger: logger.Logger;
5
6 static setInstance(options?: logger.LoggerOptions | undefined) {
7 if (options) {
8 options.customLevels = {
9 ...options.customLevels,
10 axe: 100,
11 };
12
13 if (options.transport) {
14 options.transport = {
15 ...options.transport,
16 options: {
17 ...options?.transport?.options,
18 customLevels: [
19 "trace:10",
20 "debug:20",
21 "info:30",
22 "serious:35",
23 "warn:40",
24 "error:50",
25 "fatal:60",
26 options?.transport?.options?.customLevels || "",
27 `axe:100`,
28 ].join(","),
29 },
30 };
31 }
32 }
33
34 LogService.logger = logger(options);
35 }
36
37 static instance() {
38 return LogService.logger;

Calls

no outgoing calls

Tested by

no test coverage detected