---
name: "gensio_set_log_mask"
section: "3"
platform: "linux"
package: "gensio"
version: "3.0.4-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/gensio_set_log_mask"
---

# gensio\_set\_log\_mask(3)

Logging and setting which gensio logs are passed or ignored

## NAME

gensio\_set\_log\_mask, gensio\_get\_log\_mask, gensio\_log\_level\_to\_str, - Logging and setting which gensio logs are passed or ignored

## SYNOPSIS

**#include \<gensio/gensio.h\>**

- **void gensio\_set\_log\_mask(unsigned int mask);**

  - **unsigned int gensio\_get\_log\_mask(void);**

  - **const char \*gensio\_log\_level\_to\_str(enum gensio\_log\_levels level);**

  - **void gensio\_vlog(struct gensio\_os\_funcs \*o,**

  **enum gensio\_log\_levels level,**\
   **const char \*str, va\_list args);**

- **void gensio\_log(struct gensio\_os\_funcs \*o,**

  **enum gensio\_log\_levels level,**\
   **const char \*str, ...);**

## DESCRIPTION

The log mask is a global variable in the gensio library that sets what level of logs are delivered through the vlog function pointer in **gensio\_os\_funcs.** Log levels are:

-

  GENSIO\_LOG\_FATAL GENSIO\_LOG\_ERR GENSIO\_LOG\_WARNING GENSIO\_LOG\_INFO GENSIO\_LOG\_DEBUG

with obvious meanings.  There is also:

-

  GENSIO\_LOG\_MASK\_ALL

which is a bitmask of all the log levels.

The default log mask is **(1 \<\< GENSIO\_LOG\_FATAL \| 1 \<\< GENSIO\_LOG\_ERR).** Setting other log values can be helpful in debugging problems with gensios.

**gensio\_log\_level\_to\_str** converts a log level to a string representation of that level.

**gensio\_vlog** and **gensio\_log** are the functions used to generate logs.  These are primarily for use in the gensio library, though you may use them, too, if you like.

## SEE ALSO

[gensio(5)](/gensio/5.md), [gensio\_os\_funcs(3)](/gensio_os_funcs/3.md)
