Skip to main content

createDefaultLogger

@h4ad/serverless-adapter > createDefaultLogger

(function) createDefaultLogger

The method used to create a simple logger instance to use in this library.

Signature:

export declare function createDefaultLogger(\{ level }?: LoggerOptions): ILogger;

Parameters

ParameterTypeDescription
{ level }LoggerOptions(Optional)

Returns:

ILogger

Remarks

Behind the scenes, this simple logger sends the message to the console methods.

Example

const logger = createDefaultLogger();

logger.error('An error happens.');
// An error happens.