---
title: llarp::apple::NSLogStream

---

# llarp::apple::NSLogStream





Inherits from [llarp::ILogStream](Classes/structllarp_1_1ILogStream.md)

## Public Types

|                | Name           |
| -------------- | -------------- |
| using void(*)(const char *log_this) | **[ns_logger_callback](Classes/structllarp_1_1apple_1_1NSLogStream.md#using-ns-logger-callback)**  |

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[NSLogStream](Classes/structllarp_1_1apple_1_1NSLogStream.md#function-nslogstream)**(ns_logger_callback logger) |
| virtual void | **[PreLog](Classes/structllarp_1_1apple_1_1NSLogStream.md#function-prelog)**(std::stringstream & s, LogLevel lvl, std::string_view fname, int lineno, const std::string & nodename) const override |
| virtual void | **[Print](Classes/structllarp_1_1apple_1_1NSLogStream.md#function-print)**(LogLevel lvl, std::string_view tag, const std::string & msg) override |
| virtual void | **[PostLog](Classes/structllarp_1_1apple_1_1NSLogStream.md#function-postlog)**(std::stringstream & ) const override |
| virtual void | **[ImmediateFlush](Classes/structllarp_1_1apple_1_1NSLogStream.md#function-immediateflush)**() override<br>A blocking call to flush to disk. Should only be called in rare circumstances.  |
| virtual void | **[Tick](Classes/structllarp_1_1apple_1_1NSLogStream.md#function-tick)**(llarp_time_t now) override<br>called every end of event loop tick  |

## Additional inherited members

**Public Functions inherited from [llarp::ILogStream](Classes/structllarp_1_1ILogStream.md)**

|                | Name           |
| -------------- | -------------- |
| virtual | **[~ILogStream](Classes/structllarp_1_1ILogStream.md#function-~ilogstream)**() =default |
| virtual void | **[AppendLog](Classes/structllarp_1_1ILogStream.md#function-appendlog)**(LogLevel lvl, std::string_view filename, int lineno, const std::string & nodename, const std::string msg) |


## Public Types Documentation

### using ns_logger_callback

```cpp
using llarp::apple::NSLogStream::ns_logger_callback =  void (*)(const char* log_this);
```


## Public Functions Documentation

### function NSLogStream

```cpp
inline NSLogStream(
    ns_logger_callback logger
)
```


### function PreLog

```cpp
virtual void PreLog(
    std::stringstream & s,
    LogLevel lvl,
    std::string_view fname,
    int lineno,
    const std::string & nodename
) const override
```


**Reimplements**: [llarp::ILogStream::PreLog](Classes/structllarp_1_1ILogStream.md#function-prelog)


### function Print

```cpp
virtual void Print(
    LogLevel lvl,
    std::string_view tag,
    const std::string & msg
) override
```


**Reimplements**: [llarp::ILogStream::Print](Classes/structllarp_1_1ILogStream.md#function-print)


### function PostLog

```cpp
inline virtual void PostLog(
    std::stringstream & 
) const override
```


**Reimplements**: [llarp::ILogStream::PostLog](Classes/structllarp_1_1ILogStream.md#function-postlog)


### function ImmediateFlush

```cpp
inline virtual void ImmediateFlush() override
```

A blocking call to flush to disk. Should only be called in rare circumstances. 

**Reimplements**: [llarp::ILogStream::ImmediateFlush](Classes/structllarp_1_1ILogStream.md#function-immediateflush)


### function Tick

```cpp
inline virtual void Tick(
    llarp_time_t now
) override
```

called every end of event loop tick 

**Reimplements**: [llarp::ILogStream::Tick](Classes/structllarp_1_1ILogStream.md#function-tick)


-------------------------------

Updated on 2022-07-17 at 00:14:29 +0000