Skip to main content

logger

Logger singleton module.

LogLevel

Defined in: index.ts:19

Log levels.

Enumeration Members

debug

debug: "debug";

Defined in: index.ts:20

error

error: "error";

Defined in: index.ts:21

info

info: "info";

Defined in: index.ts:22

log

log: "log";

Defined in: index.ts:23

success

success: "success";

Defined in: index.ts:24

warn

warn: "warn";

Defined in: index.ts:25


log()

function log(message, level): void

Defined in: index.ts:85

Logs a message by calling the active logger instance.

Parameters

message

string

a string to be logged.

level

optional log level, "info" by default.

"debug" | "error" | "info" | "log" | "success" | "warn" | LogLevel

Returns

void

Remarks

If a log level is not supported by the logger instance, then it defaults to "info".

Example

import { log } from "@graphql-markdown/utils/logger";

log("Info message"); // Expected console output "Info message"

Logger()

function Logger(moduleName?): Promise<void>

Defined in: index.ts:45

Instantiate a logger module. By default, the logger module uses global.console

Parameters

moduleName?

string

optional name of the logger package.

Returns

Promise<void>

Example

import Logger, { log } from "@graphql-markdown/utils/logger";

log("Info message"); // Expected console output "Info message"

Logger("@docusaurus/logger");
log("Info message", "info"); // Expected Docusaurus log output "Info message"