Skip to main content

@graphql-markdown/logger

Latest Version GitHub License Technical Debt Coverage Mutation Score

Logger singleton module.

LogLevel​

Defined in: index.ts:20

Log levels.

Enumeration Members​

debug​

debug: "debug";

Defined in: index.ts:21

error​

error: "error";

Defined in: index.ts:22

info​

info: "info";

Defined in: index.ts:23

log​

log: "log";

Defined in: index.ts:24

success​

success: "success";

Defined in: index.ts:25

warn​

warn: "warn";

Defined in: index.ts:26


log()​

function log(message, level): void

Defined in: index.ts:86

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/logger";

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

Logger()​

function Logger(moduleName?): Promise<void>

Defined in: index.ts:46

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/logger";

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

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