File: log.h

package info (click to toggle)
linux-minidisc 0.9.13-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,096 kB
  • ctags: 1,530
  • sloc: ansic: 6,345; cpp: 2,569; python: 2,451; perl: 866; sh: 22; makefile: 8
file content (51 lines) | stat: -rw-r--r-- 1,273 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef LIBNETMD_TRACE_H
#define LIBNETMD_TRACE_H

/**
   log level
*/
typedef enum {
        /** Not a log level. Should only be used to filter all log messages so
            that no messages are displayed */
        NETMD_LOG_NONE,

        /** fatal error message */
        NETMD_LOG_ERROR,

        /** warning messages */
        NETMD_LOG_WARNING,

        /** messages to display */
        NETMD_LOG_DEBUG,

        /** Not a log level. Should only be used to display all messages. Should
            be the level with the highest value. */
        NETMD_LOG_ALL
} netmd_loglevel;

/**
   Sets the global log level.

   @param level The maximal log level. All messages with a higher log level are
                filtered out and will not be displayed.
*/
void netmd_set_log_level(netmd_loglevel level);

/**
   Shows a hexdump of binary data.

   @param level Log level of this message.
   @param data Pointer to binary data to display.
   @param len Length of the data.
*/
void netmd_log_hex(netmd_loglevel level, const unsigned char* const data, const size_t len);

/**
   Printf like log function.

   @param level Log level of this message.
   @param fmt printf-like format string
*/
void netmd_log(netmd_loglevel level, const char* const fmt, ...);

#endif