LibInsane: /build/libinsane/src/libinsane/subprojects/libinsane/include/libinsane/log.h File Reference

| LibInsane 1.0.10 Cross-platform Cross-API Cross-driver Cross-image-scanner Image Scan Library

Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
log.h File Reference

Go to the source code of this file.

## Data Structures
struct | lis_log_callbacks

## Macros
#define | lis_log_debug(...) lis_log(LIS_LOG_LVL_DEBUG, __FILE__, __LINE__, __func__, __VA_ARGS__);
#define | lis_log_info(...) lis_log(LIS_LOG_LVL_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__);
#define | lis_log_warning(...) lis_log(LIS_LOG_LVL_WARNING, __FILE__, __LINE__, __func__, __VA_ARGS__);
#define | lis_log_error(...) lis_log(LIS_LOG_LVL_ERROR, __FILE__, __LINE__, __func__, __VA_ARGS__);

## Typedefs
typedef void | lis_log_callback(enum lis_log_level lvl, const char *msg)
| log callback

## Enumerations
enum | lis_log_level { LIS_LOG_LVL_MIN = 0 , LIS_LOG_LVL_DEBUG = LIS_LOG_LVL_MIN , LIS_LOG_LVL_INFO , LIS_LOG_LVL_WARNING , LIS_LOG_LVL_ERROR , LIS_LOG_LVL_MAX = LIS_LOG_LVL_ERROR }

## Functions
void | lis_set_log_callbacks (const struct lis_log_callbacks *callbacks)
| register callbacks that will be used to get back messages. Only one set of callbacks can be registered at one time. Calling this function will unset previously set callbacks. By default, all log messages go to stderr.
void | lis_log (enum lis_log_level lvl, const char *file, int line, const char *func, const char *fmt,...)
void | lis_log_raw (enum lis_log_level lvl, const char *msg)
void | lis_log_reset (void)

## Variables
lis_log_callback | lis_log_stderr
| default log callback provided for convenience. Will log to stderr.
lis_log_callback | lis_log_stdout
| default log callback provided for convenience. Will log to stdout.

## Macro Definition Documentation

## ◆ lis_log_debug

#define lis_log_debug | ( |  | ... | ) | lis_log(LIS_LOG_LVL_DEBUG, __FILE__, __LINE__, __func__, __VA_ARGS__);

Definition at line 45 of file log.h.

## ◆ lis_log_error

#define lis_log_error | ( |  | ... | ) | lis_log(LIS_LOG_LVL_ERROR, __FILE__, __LINE__, __func__, __VA_ARGS__);

Definition at line 48 of file log.h.

## ◆ lis_log_info

#define lis_log_info | ( |  | ... | ) | lis_log(LIS_LOG_LVL_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__);

Definition at line 46 of file log.h.

## ◆ lis_log_warning

#define lis_log_warning | ( |  | ... | ) | lis_log(LIS_LOG_LVL_WARNING, __FILE__, __LINE__, __func__, __VA_ARGS__);

Definition at line 47 of file log.h.

## Typedef Documentation

## ◆ lis_log_callback

typedef void lis_log_callback(enum lis_log_level lvl, const char *msg)

log callback

Parameters

  [in] | msg | does no include "\n".

Definition at line 18 of file log.h.

## Enumeration Type Documentation

## ◆ lis_log_level

enum lis_log_level

Enumerator
LIS_LOG_LVL_MIN |
LIS_LOG_LVL_DEBUG |
LIS_LOG_LVL_INFO |
LIS_LOG_LVL_WARNING |
LIS_LOG_LVL_ERROR |
LIS_LOG_LVL_MAX |

Definition at line 4 of file log.h.

## Function Documentation

## ◆ lis_log()

void lis_log | ( | enum lis_log_level | lvl,
|  | const char * | file,
|  | int | line,
|  | const char * | func,
|  | const char * | fmt,
|  |  | ... )
| extern

## ◆ lis_log_raw()

void lis_log_raw | ( | enum lis_log_level | lvl,
|  | const char * | msg )
| extern

## ◆ lis_log_reset()

void lis_log_reset | ( | void |  | ) |
| extern

## ◆ lis_set_log_callbacks()

void lis_set_log_callbacks | ( | const struct lis_log_callbacks * | callbacks | ) |
| extern

register callbacks that will be used to get back messages. Only one set of callbacks can be registered at one time. Calling this function will unset previously set callbacks. By default, all log messages go to stderr.

Parameters

  [in] | callbacks | callback to use. Pointer must remain valid until lis_set_log_callbacks is called again. NULL will reset callbacks to their default (stderr).

## Variable Documentation

## ◆ lis_log_stderr

lis_log_callback lis_log_stderr

default log callback provided for convenience. Will log to stderr.

Definition at line 59 of file log.h.

## ◆ lis_log_stdout

lis_log_callback lis_log_stdout

default log callback provided for convenience. Will log to stdout.

Definition at line 66 of file log.h.