---
description: Utility class to log information
---

# logger - console

Anacleto saves the logs of your scripts in rotating files using the json format.&#x20;

The logging functionality can be accessed using both the `console` and `logger` classes. Both features give access to the methods `log`, `info`, `warn`, `error` all these methods allow you to pass a variable number of attributes and they will arrange themselves to create a properly formatted log.

{% hint style="info" %}
Use `logger` on `console` as you prefer
{% endhint %}

{% hint style="info" %}
Don't concatenate strings in the log, let logger do its job!
{% endhint %}

### Example

```javascript
const resp = {success: true, data : [1,2,3]}
logger.info(`Resp`, resp);
```

console result

```
Resp {success:true,data:[1,2,3]}
```

## log

Log a message

### Syntax

```javascript
console.log(msg)
```

## info

Log a info level message

### Syntax

```javascript
console.info(msg,[data..])
```

## warn

Log a warn level message

### Syntax

```javascript
console.warn(msg,[data..])
```

## error

Log a error level message

### Syntax

```javascript
console.error(msg,[data..])
```
