> This page is for version 5.0 (Latest) (default).
> For other versions, use one of these documentation indexes:
> - 5.0 (Latest) (default): https://docs.nvidia.com/holoscan/sdk-user-guide/5-0-latest/llms.txt
> - ltsb-2.0: https://docs.nvidia.com/holoscan/sdk-user-guide/ltsb-2-0/llms.txt
> - 4.6: https://docs.nvidia.com/holoscan/sdk-user-guide/4-6/llms.txt
> - 4.5: https://docs.nvidia.com/holoscan/sdk-user-guide/4-5/llms.txt
> - 4.4: https://docs.nvidia.com/holoscan/sdk-user-guide/4-4/llms.txt
> - 4.3: https://docs.nvidia.com/holoscan/sdk-user-guide/4-3/llms.txt
> - Archives: https://docs.nvidia.com/holoscan/sdk-user-guide/archives/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sdk-user-guide/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sdk-user-guide/_mcp/server.

# holoscan::logger::ILogger

> Interface for custom logger implementations.

Interface for custom logger implementations.

`ILogger` provides an interface for implementing custom logging mechanisms, allowing the integration of various logging systems with the [Logger](logger) class.

```cpp showLineNumbers={false}
#include <holoscan/logger/spdlog_logger.hpp>
```

---

## Constructors

### Destructor \[#destructor]

### \~ILogger

```cpp showLineNumbers={false}
virtual holoscan::logger::ILogger::~ILogger() = default
```

---

## Methods

### log \[#log]

```cpp showLineNumbers={false}
virtual void holoscan::logger::ILogger::log(
    const char *file,
    int line,
    const char *name,
    int level,
    const char *message,
    void *arg
)
```

Log a message.

**Parameters**

**`file`** `const char *`

The name of the source file where the log request originated.

---

**`line`** `int`

The line number in the source file.

---

**`name`** `const char *`

The name of the function/module making the log request.

---

**`level`** `int`

The log level.

---

**`message`** `const char *`

The log message.

---

**`arg`** `void *`

An optional argument for additional log information.

---

### pattern \[#pattern]

#### Mutable

```cpp showLineNumbers={false}
virtual void holoscan::logger::ILogger::pattern(
    const char *pattern
)
```

Set the log message pattern.

#### Const

const

nodiscard

```cpp showLineNumbers={false}
virtual const char * holoscan::logger::ILogger::pattern() const
```

Get the current log message pattern.

### level \[#level]

#### Mutable

```cpp showLineNumbers={false}
virtual void holoscan::logger::ILogger::level(
    int level
)
```

Set the log level.

#### Const

const

nodiscard

```cpp showLineNumbers={false}
virtual int holoscan::logger::ILogger::level() const
```

Get the current log level.

### redirect \[#redirect]

#### Mutable

```cpp showLineNumbers={false}
virtual void holoscan::logger::ILogger::redirect(
    int level,
    void *output
)
```

Redirect log output to the specified file/output for the given log level.

#### Const

const

nodiscard

```cpp showLineNumbers={false}
virtual void * holoscan::logger::ILogger::redirect(
    int level
) const
```

Get the current redirection for the specified log level (nullptr if none).