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
Name | Type |
---|---|
moduleName | string |
core | Core |
Returns
_makeLogMessage
▸ _makeLogMessage(message
): string
Parameters
Name | Type |
---|---|
message | string |
Returns
string
debug
▸ debug(message
, details?
): void
Parameters
Name | Type |
---|---|
message | string |
details? | Details |
Returns
void
error
▸ error(error
, details?
): void
Parameters
Name | Type |
---|---|
error | string | Error |
details? | Details |
Returns
void
info
▸ info(message
, details?
): void
Parameters
Name | Type |
---|---|
message | string |
details? | Details |
Returns
void
verbose
▸ verbose(message
, details?
): void
Parameters
Name | Type |
---|---|
message | string |
details? | Details |
Returns
void
warn
▸ warn(message
, details?
): void
Parameters
Name | Type |
---|---|
message | string |
details? | Details |
Returns
void
Constructors
constructor
• new LoggerController(moduleName
, config
)
Parameters
Name | Type |
---|---|
moduleName | string |
config | Config |
Accessors
level
• get
level(): LogLevel