Skip to main content

Class: LoggerController

moralis-monorepo / @moralisweb3/common-core / LoggerController

Class: LoggerController

@moralisweb3/common-core.LoggerController

LoggerController, responsible to create log messages for each module. It should be created with the name of the module like new Logger('module-name') It will then prefix any logs with that module-name for easy debugging It will show only logs up to the specified logLevel in the MoralisConfig

Table of contents

Methods

Constructors

Accessors

Methods

create

Static create(moduleName, core): LoggerController

Parameters

NameType
moduleNamestring
coreCore

Returns

LoggerController


_makeLogMessage

_makeLogMessage(message): string

Parameters

NameType
messagestring

Returns

string


debug

debug(message, details?): void

Parameters

NameType
messagestring
details?Details

Returns

void


error

error(error, details?): void

Parameters

NameType
errorstring | Error
details?Details

Returns

void


info

info(message, details?): void

Parameters

NameType
messagestring
details?Details

Returns

void


verbose

verbose(message, details?): void

Parameters

NameType
messagestring
details?Details

Returns

void


warn

warn(message, details?): void

Parameters

NameType
messagestring
details?Details

Returns

void

Constructors

constructor

new LoggerController(moduleName, config)

Parameters

NameType
moduleNamestring
configConfig

Accessors

level

get level(): LogLevel

Returns

LogLevel