On this page

# Logger

Logger

This is a minimalistic implementation of a logger to be used if no other logger is provided.

## Constructor

### new Logger(level)

The Logger constructor.

Accepts the log level to output.

Parameters:

Name | Type | Default | Description
--- | --- | --- | ---
`level` | string | info |

Source
  - app.logger.js, line 8

## Classes

Logger

## Members

### type :string

Flag for identifying this logger throughout the SDK.

Type:

- string

Source
  - app.logger.js, line 14

## Methods

### (private) _print(level, message, stackTrace)

Internal method that formats and outputs the logged message.

Parameters:

Name | Type | Description
--- | --- | ---
`level` | string | number |
`message` | string |
`stackTrace` | Object |

Source
  - app.logger.js, line 97

### debug(message, contextopt)

Shorthand method for printing a debug level log entry.

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`message` | string |  |
`context` | Object | <optional> | Optional parameter, can be used for printing stack traces.

Source
  - app.logger.js, line 43

### error(message, stackTraceopt)

Shorthand method for printing a critical error level log entry.

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`message` | string |  |
`stackTrace` | Object | <optional> | Optional parameter, can be used for printing stack traces.

Source
  - app.logger.js, line 53

### getLevel() → {string}

Returns the currently configured logging level.

Source
  - app.logger.js, line 85

Returns:

Type:
  string

### log(message, contextopt)

Shorthand method for printing a normal level log entry.

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`message` | string |  |
`context` | Object | <optional> | Optional parameter, can be used for printing stack traces.

Source
  - app.logger.js, line 33

### setLevel(level)

Allows to set for a specific log level.

Parameters:

Name | Type | Description
--- | --- | ---
`level` | string |

Source
  - app.logger.js, line 72

### warn(message, contextopt)

Shorthand method for printing an error or warning level log entry.

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`message` | string |  |
`context` | Object | <optional> | Optional parameter, can be used for printing stack traces.

Source
  - app.logger.js, line 63

Type anything to view search result