@graphql-markdown/logger
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"