# Logger | @aa-sdk/core

> Logger class provides static methods for logging at different levels such as error, warn, debug, info, and verbose. This class allows setting log levels and log filters to control the logging behavior.

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

Defined in: [aa-sdk/core/src/logger.ts:13](https://github.com/alchemyplatform/aa-sdk/blob/main/aa-sdk/core/src/logger.ts#L13)

Logger class provides static methods for logging at different levels such as error, warn, debug, info, and verbose. This class allows setting log levels and log filters to control the logging behavior.

## Constructors

### Constructor

```ts
new Logger(): Logger;
```

#### Returns

`Logger`

## Properties

<table>
  <thead>
    <tr>
      <th align="left">Property</th>
      <th align="left">Type</th>
      <th align="left">Default value</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        <a id="logfilter" /> `logFilter?`
      </td>

      <td>
        `string`
      </td>

      <td>
        `undefined`
      </td>
    </tr>

    <tr>
      <td>
        <a id="loglevel" /> `logLevel`
      </td>

      <td>
        [`LogLevel`](../enumerations/LogLevel)
      </td>

      <td>
        `LogLevel.INFO`
      </td>
    </tr>

  </tbody>
</table>

## Methods

### debug()

```ts
static debug(msg, ...args): void;
```

Defined in: [aa-sdk/core/src/logger.ts:99](https://github.com/alchemyplatform/aa-sdk/blob/main/aa-sdk/core/src/logger.ts#L99)

Logs a debug message to the console if the log level allows it.

#### Example

```ts
import { Logger } from "@aa-sdk/core";

Logger.debug("Something is happening");
```

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `msg`
      </td>

      <td>
        `string`
      </td>

      <td>
        The message to log
      </td>
    </tr>

    <tr>
      <td>
        ...`args`
      </td>

      <td>
        `any`\[]
      </td>

      <td>
        Additional arguments to pass to the console.debug method
      </td>
    </tr>

  </tbody>
</table>

#### Returns

`void`

---

### error()

```ts
static error(msg, ...args): void;
```

Defined in: [aa-sdk/core/src/logger.ts:61](https://github.com/alchemyplatform/aa-sdk/blob/main/aa-sdk/core/src/logger.ts#L61)

Logs an error message to the console if the logging condition is met.

#### Example

```ts
import { Logger } from "@aa-sdk/core";

Logger.error("An error occurred while processing the request");
```

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `msg`
      </td>

      <td>
        `string`
      </td>

      <td>
        The primary error message to be logged
      </td>
    </tr>

    <tr>
      <td>
        ...`args`
      </td>

      <td>
        `any`\[]
      </td>

      <td>
        Additional arguments to be logged along with the error message
      </td>
    </tr>

  </tbody>
</table>

#### Returns

`void`

---

### info()

```ts
static info(msg, ...args): void;
```

Defined in: [aa-sdk/core/src/logger.ts:118](https://github.com/alchemyplatform/aa-sdk/blob/main/aa-sdk/core/src/logger.ts#L118)

Logs an informational message to the console if the logging level is set to INFO.

#### Example

```ts
import { Logger } from "@aa-sdk/core";

Logger.info("Something is happening");
```

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `msg`
      </td>

      <td>
        `string`
      </td>

      <td>
        the message to log
      </td>
    </tr>

    <tr>
      <td>
        ...`args`
      </td>

      <td>
        `any`\[]
      </td>

      <td>
        additional arguments to log alongside the message
      </td>
    </tr>

  </tbody>
</table>

#### Returns

`void`

---

### setLogFilter()

```ts
static setLogFilter(pattern): void;
```

Defined in: [aa-sdk/core/src/logger.ts:44](https://github.com/alchemyplatform/aa-sdk/blob/main/aa-sdk/core/src/logger.ts#L44)

Sets the log filter pattern.

#### Example

```ts
import { Logger } from "@aa-sdk/core";

Logger.setLogFilter("error");
```

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `pattern`
      </td>

      <td>
        `string`
      </td>

      <td>
        The pattern to set as the log filter
      </td>
    </tr>

  </tbody>
</table>

#### Returns

`void`

---

### setLogLevel()

```ts
static setLogLevel(logLevel): void;
```

Defined in: [aa-sdk/core/src/logger.ts:28](https://github.com/alchemyplatform/aa-sdk/blob/main/aa-sdk/core/src/logger.ts#L28)

Sets the log level for logging purposes.

#### Example

```ts
import { Logger, LogLevel } from "@aa-sdk/core";
Logger.setLogLevel(LogLevel.DEBUG);
```

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `logLevel`
      </td>

      <td>
        [`LogLevel`](../enumerations/LogLevel)
      </td>

      <td>
        The desired log level
      </td>
    </tr>

  </tbody>
</table>

#### Returns

`void`

---

### verbose()

```ts
static verbose(msg, ...args): void;
```

Defined in: [aa-sdk/core/src/logger.ts:137](https://github.com/alchemyplatform/aa-sdk/blob/main/aa-sdk/core/src/logger.ts#L137)

Logs a message with additional arguments if the logging level permits it.

#### Example

```ts
import { Logger } from "@aa-sdk/core";

Logger.verbose("Something is happening");
```

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `msg`
      </td>

      <td>
        `string`
      </td>

      <td>
        The message to log
      </td>
    </tr>

    <tr>
      <td>
        ...`args`
      </td>

      <td>
        `any`\[]
      </td>

      <td>
        Additional arguments to be logged
      </td>
    </tr>

  </tbody>
</table>

#### Returns

`void`

---

### warn()

```ts
static warn(msg, ...args): void;
```

Defined in: [aa-sdk/core/src/logger.ts:80](https://github.com/alchemyplatform/aa-sdk/blob/main/aa-sdk/core/src/logger.ts#L80)

Logs a warning message if the logging conditions are met.

#### Example

```ts
import { Logger } from "@aa-sdk/core";

Logger.warn("Careful...");
```

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `msg`
      </td>

      <td>
        `string`
      </td>

      <td>
        The message to log as a warning
      </td>
    </tr>

    <tr>
      <td>
        ...`args`
      </td>

      <td>
        `any`\[]
      </td>

      <td>
        Additional parameters to log along with the message
      </td>
    </tr>

  </tbody>
</table>

#### Returns

`void`