|
void | pynq_log (const LogLevel level, char const *domain, char const *location, unsigned int lineno, char const *fmt,...) |
|
Functions for error handling and logging.
int main (void)
{
pynq_log(
"Print my information message");
return EXIT_SUCCESS;
}
void pynq_log(const LogLevel level, char const *domain, char const *location, unsigned int lineno, char const *fmt,...)
#define pynq_warning(...)
Or with a custom log domain
#undef LOG_DOMAIN
#define LOG_DOMAIN "MyApp"
int main ( int argc, char **argv)
{
pynq_log(
"Print my information message");
return EXIT_SUCCESS;
}
◆ pynq_error
#define pynq_error |
( |
|
... | ) |
|
Value: do { \
__VA_ARGS__); \
for (;;) \
; \
} while (0)
- Parameters
-
Wrapper around pynq_log to print error messages. This expects LOG_DOMAIN to be set.
Definition at line 118 of file log.h.
◆ pynq_info
- Parameters
-
Wrapper around pynq_log to print info messages. This expects LOG_DOMAIN to be set.
Definition at line 100 of file log.h.
◆ pynq_warning
- Parameters
-
Wrapper around pynq_log to print warning messages. This expects LOG_DOMAIN to be set.
Definition at line 109 of file log.h.
◆ LogLevel
◆ LogLevel
Enumerator |
---|
LOG_LEVEL_INFO | Informational messages.
|
LOG_LEVEL_WARNING | Warning messages
|
LOG_LEVEL_ERROR | Error messages
|
NUM_LOG_LEVELS | Number of log levels
|
Definition at line 65 of file log.h.
◆ pynq_log()
void pynq_log |
( |
const LogLevel |
level, |
|
|
char const * |
domain, |
|
|
char const * |
location, |
|
|
unsigned int |
lineno, |
|
|
char const * |
fmt, |
|
|
|
... |
|
) |
| |
- Parameters
-
level | The LogLevel of this mssage. |
domain | The log domain. |
fmt | The format string. |
location | The location string of the message origin. |
lineno | The line number of the message origin. |
... | The arguments to the format string. |
Print log messages with loglevel WARNING and higher. Messages of level ERROR will result in an abort().
Environment DEBUG will print out level LOG_LEVEL_INFO Environment FATAL_WARNING will abort after a warning.
Definition at line 52 of file log.c.