> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# QSH Log

**Header:** `utils/inc/qshLog.h`

## Functions

### `sns_log_message`

```cpp theme={null}
void sns_log_message(int level, const char *fmt,...)
```

### `set_level`

sets global log level for current process

```cpp theme={null}
void set_level(log_level level)
```

**Parameters**

<ParamField path="level" type="log_level" />

### `get_tag`

get current log tag

```cpp theme={null}
const char * get_tag()
```

**Returns**

const char\*

### `set_tag`

set log tag

```cpp theme={null}
void set_tag(const char *tag)
```

**Parameters**

<ParamField path="tag" type="const char *" />

### `get_level`

get current log level value

```cpp theme={null}
log_level get_level()
```

**Returns**

log\_level

### `set_stderr_logging`

enable/disable logging over stderr

```cpp theme={null}
void set_stderr_logging(bool val)
```

**Parameters**

<ParamField path="enable" type="" />

### `get_stderr_logging`

get current status of stderr logging

```cpp theme={null}
bool get_stderr_logging()
```

**Returns**

bool

## Enumerations

### `log_level`

#### Values

| Name      | Value | Description |
| --------- | ----- | ----------- |
| `SILENT`  | = 0   |             |
| `ERROR`   | = 1   |             |
| `INFO`    | = 2   |             |
| `DEBUG`   | = 3   |             |
| `VERBOSE` | = 4   |             |

## Macros

### `sns_logv`

```c theme={null}
#define sns_logv sns_log_message(sensors_log::VERBOSE, "%s:%d, " fmt, __FUNCTION__, __LINE__, ##args)
```

### `sns_loge`

```c theme={null}
#define sns_loge sns_log_message(sensors_log::ERROR, "%s:%d, " fmt, __FUNCTION__, __LINE__, ##args)
```

### `sns_logd`

```c theme={null}
#define sns_logd sns_log_message(sensors_log::DEBUG, "%s:%d, " fmt, __FUNCTION__, __LINE__, ##args)
```

### `sns_logi`

```c theme={null}
#define sns_logi sns_log_message(sensors_log::INFO, "%s:%d, " fmt, __FUNCTION__, __LINE__, ##args)
```
