# Logging utils

### Logging

The `logger` object is the main object for logging functions.

#### logger.trace(...msg)

Creates TRACE level logging messages. It concatenates msg parameters to compound message to be logged.

**Returns**: void

| Param            | Type    | Description                                                                |
| ---------------- |---------| -------------------------------------------------------------------------- |
| msg    | string  | list of elements to be concatenated to generate the string message to be printed. |

Example of use:
```javascript
logger.trace('Operation sent to', host_var, ' and port ', port_var, '. Operation content: ', operation_var);
```


#### logger.debug(...msg)

Creates DEBUG level logging messages. It concatenates msg parameters to compound message to be logged.

**Returns**: void

| Param            | Type    | Description                                                                |
| ---------------- |---------| -------------------------------------------------------------------------- |
| msg    | string  | list of elements to be concatenated to generate the string message to be printed. |

Example of use:
```javascript
logger.debug('Operation sent to', host_var, ' and port ', port_var, '. Operation content: ', operation_var);
```

#### logger.info(...msg)

Creates INFO level logging messages. It concatenates msg parameters to compound message to be logged.

**Returns**: void

| Param            | Type    | Description                                                                |
| ---------------- |---------| -------------------------------------------------------------------------- |
| msg    | string  | list of elements to be concatenated to generate the string message to be printed. |

Example of use:
```javascript
logger.info('Operation sent to', host_var, ' and port ', port_var, '. Operation content: ', operation_var);
```

#### logger.warn(...msg)

Creates WARN level logging messages. It concatenates msg parameters to compound message to be logged.

**Returns**: void

| Param            | Type    | Description                                                                |
| ---------------- |---------| -------------------------------------------------------------------------- |
| msg    | string  | list of elements to be concatenated to generate the string message to be printed. |

Example of use:
```javascript
logger.warn('Operation sent to', host_var, ' and port ', port_var, '. Operation content: ', operation_var);
```

#### logger.error(...msg)

Creates ERROR level logging messages. It concatenates msg parameters to compound message to be logged.

**Returns**: void

| Param            | Type    | Description                                                                |
| ---------------- |---------| -------------------------------------------------------------------------- |
| msg    | string  | list of elements to be concatenated to generate the string message to be printed. |

Example of use:
```javascript
logger.error('Error connecting to host ', host_var, ' and port ', port_var, '. Stop processing');
```