clibdocker
0.1.0-alpha.0
A Docker API for C
|
Docker API logger for internal use mainly. It is based on rxi's log implementation with minor changes in function names. See License header. More...
Go to the source code of this file.
Macros | |
#define | LOG_VERSION "0.1.0" |
#define | docker_log_trace(...) docker_log_log(LOG_TRACE, __FILE__, __LINE__, __VA_ARGS__) |
Trace log entry. More... | |
#define | docker_log_debug(...) docker_log_log(LOG_DEBUG, __FILE__, __LINE__, __VA_ARGS__) |
Debug log entry. More... | |
#define | docker_log_info(...) docker_log_log(LOG_INFO, __FILE__, __LINE__, __VA_ARGS__) |
Info log entry. More... | |
#define | docker_log_warn(...) docker_log_log(LOG_WARN, __FILE__, __LINE__, __VA_ARGS__) |
Warning log entry. More... | |
#define | docker_log_error(...) docker_log_log(LOG_ERROR, __FILE__, __LINE__, __VA_ARGS__) |
Error log entry. More... | |
#define | docker_log_fatal(...) docker_log_log(LOG_FATAL, __FILE__, __LINE__, __VA_ARGS__) |
Fatal log entry. More... | |
Typedefs | |
typedef void(* | log_LockFn) (void *udata, int lock) |
Enumerations | |
enum | { LOG_TRACE , LOG_DEBUG , LOG_INFO , LOG_WARN , LOG_ERROR , LOG_FATAL } |
Functions | |
void | docker_log_set_udata (void *udata) |
Set the user data for the logger. More... | |
void | docker_log_set_lock (log_LockFn fn) |
Set the lock function for the logger. More... | |
void | docker_log_set_fp (FILE *fp) |
Set the file pointer for the logger. More... | |
void | docker_log_set_level (int level) |
Enable the given log level. More... | |
void | docker_log_set_quiet (int enable) |
Turn off the given log level. More... | |
void | docker_log_log (int level, const char *file, int line, const char *fmt,...) |
Internal method for logging, called by all specific log level loggers. More... | |
Docker API logger for internal use mainly. It is based on rxi's log implementation with minor changes in function names. See License header.
Copyright (c) 2017 rxi
This library is free software; you can redistribute it and/or modify it under the terms of the MIT license. See log.c
for details.
#define docker_log_debug | ( | ... | ) | docker_log_log(LOG_DEBUG, __FILE__, __LINE__, __VA_ARGS__) |
Debug log entry.
... | data to log |
#define docker_log_error | ( | ... | ) | docker_log_log(LOG_ERROR, __FILE__, __LINE__, __VA_ARGS__) |
Error log entry.
... | data to log |
#define docker_log_fatal | ( | ... | ) | docker_log_log(LOG_FATAL, __FILE__, __LINE__, __VA_ARGS__) |
Fatal log entry.
... | data to log |
#define docker_log_info | ( | ... | ) | docker_log_log(LOG_INFO, __FILE__, __LINE__, __VA_ARGS__) |
Info log entry.
... | data to log |
#define docker_log_trace | ( | ... | ) | docker_log_log(LOG_TRACE, __FILE__, __LINE__, __VA_ARGS__) |
Trace log entry.
... | data to log |
#define docker_log_warn | ( | ... | ) | docker_log_log(LOG_WARN, __FILE__, __LINE__, __VA_ARGS__) |
Warning log entry.
... | data to log |
#define LOG_VERSION "0.1.0" |
LOG API Version
typedef void(* log_LockFn) (void *udata, int lock) |
function type for a lock implementation to be used by the logger if locking is enabled
void docker_log_log | ( | int | level, |
const char * | file, | ||
int | line, | ||
const char * | fmt, | ||
... | |||
) |
Internal method for logging, called by all specific log level loggers.
level | log level |
file | file pointer |
line | line number |
fmt | format string |
... | arguments to the logger |
void docker_log_set_fp | ( | FILE * | fp | ) |
Set the file pointer for the logger.
fp | file pointer |
void docker_log_set_level | ( | int | level | ) |
Enable the given log level.
level | level number (see log levels enum) |
void docker_log_set_lock | ( | log_LockFn | fn | ) |
Set the lock function for the logger.
fn | lock function |
void docker_log_set_quiet | ( | int | enable | ) |
Turn off the given log level.
enable | level nubmer (see log levels enum) |
void docker_log_set_udata | ( | void * | udata | ) |
Set the user data for the logger.
udata | userdata pointer |