Skip to content

DebugLogger

Defined in: src/logger.ts:235

A Logger instance, suitable for use in ICreateClientOpts.logger, which will write to the debug library.

import debug from "debug";
const client = createClient({
baseUrl: hubUrl,
userId: userId,
accessToken: "akjgkrgjs",
deviceId: "xzcvb",
logger: new DebugLogger(debug(`digital-world-messaging-sdk:${userId}`)),
});
  • Logger

new DebugLogger(debugInstance): DebugLogger

Defined in: src/logger.ts:236

Debugger

DebugLogger

debug(…msg): void

Defined in: src/logger.ts:242

Output debug message to the logger.

any[]

Data to log.

void

Logger.debug


error(…msg): void

Defined in: src/logger.ts:254

Output error message to the logger.

any[]

Data to log.

void

Logger.error


getChild(namespace): DebugLogger

Defined in: src/logger.ts:258

Create a child logger.

This child will use the methodFactory of the parent, so any log extensions applied to the parent at the time of calling getChild will be applied to the child as well. It will NOT apply changes to the parent’s methodFactory after the child was created. Those changes need to be applied to the child manually.

string

name to add to the current logger to generate the child. Some implementations of Logger use this as a prefix; others use a different mechanism.

DebugLogger

Logger.getChild


info(…msg): void

Defined in: src/logger.ts:246

Output info message to the logger.

any[]

Data to log.

void

Logger.info


trace(…msg): void

Defined in: src/logger.ts:238

Output trace message to the logger, with stack trace.

any[]

Data to log.

void

Logger.trace


warn(…msg): void

Defined in: src/logger.ts:250

Output warn message to the logger.

any[]

Data to log.

void

Logger.warn