2 #ifndef COBARO_LOG0_LOG_H
3 #define COBARO_LOG0_LOG_H
75 #define COBARO_LOG_PARAM_MAX (8) // Search log.c for PARAM_MAX_FIX if changed
361 char *buffer,
size_t buflen);
Normal but significant condition.
Definition: log.h:67
bool cobaro_log(cobaro_loghandle_t lh, cobaro_log_t log)
Emit a log to the loghandle's default destination.
Value is a string.
Definition: log.h:53
Informational.
Definition: log.h:68
uint32_t id
Opaque header for use in identifying this object as a log message, when multiple structure types are ...
Definition: log.h:87
void cobaro_log_set_string(cobaro_log_t log, int argnum, const char *source)
Helper function for setting a string parameter.
void cobaro_log_messages_set(cobaro_loghandle_t lh, char **messages)
Set the message catalog in use (in case you want to change language).
Action must be taken immediately.
Definition: log.h:63
cobaro_log_levels
Log levels as they come from syslog(3).
Definition: log.h:61
void cobaro_log_set_integer(cobaro_log_t log, int argnum, int64_t source)
Helper function for setting an integer parameter.
union cobaro_log::@0::@1 v
Value.
Value is a signed integer.
Definition: log.h:54
uint32_t code
Log code. Zero is successful.
Definition: log.h:90
#define COBARO_LOG_PARAM_MAX
Number of parameters in a log message structure.
Definition: log.h:75
void cobaro_log_publish(cobaro_loghandle_t lh, cobaro_log_t log)
Publish a log_t relinqushing its memory.
uint8_t level
Log level, from cobaro_log_levels enumeration.
Definition: log.h:96
int cobaro_log_to_string(cobaro_loghandle_t lh, cobaro_log_t log, char *buffer, size_t buflen)
Log a message to a string.
double f
Floating point value.
Definition: log.h:120
cobaro_log_types
Type discriminator for parameter values in logs.
Definition: log.h:52
Debug-level messages.
Definition: log.h:69
char * cobaro_log_version(void)
Printable version number.
Value is an IP address (in 32 bit network format).
Definition: log.h:56
void cobaro_log_set_double(cobaro_log_t log, int argnum, double source)
Helper function for setting an double parameter.
bool cobaro_log_loglevel_set(cobaro_loghandle_t lh, int level)
Set the log level below which we should ignore logs.
struct cobaro_log * cobaro_log_t
Log structure pointer type.
Definition: log.h:135
System is unusable.
Definition: log.h:62
cobaro_loghandle_t cobaro_log_init(char **messages)
Initialize the logging infrastructure.
char pad[44]
Pad to make us fit into 512 bytes exactly.
Definition: log.h:101
void cobaro_log_return(cobaro_loghandle_t lh, cobaro_log_t log)
Return a log structure to the free list.
char s[48]
String value.
Definition: log.h:114
int64_t i
Integer value.
Definition: log.h:117
Error conditions.
Definition: log.h:65
int cobaro_log_to_file(cobaro_loghandle_t lh, cobaro_log_t log, FILE *f)
Log a message to file.
bool cobaro_log_file_set(cobaro_loghandle_t lh, FILE *f)
Set the default log destination to be a file handle.
void cobaro_log_to_syslog(cobaro_loghandle_t lh, cobaro_log_t log)
Log a message to syslog.
uint32_t ipv4
IPv4 address (32 bit network format)
Definition: log.h:123
uint8_t type
Value type discriminant.
Definition: log.h:107
cobaro_log_t cobaro_log_claim(cobaro_loghandle_t lh)
Acquire a log structure from the handle's free list.
Value is a double.
Definition: log.h:55
Warning conditions.
Definition: log.h:66
struct cobaro_loghandle * cobaro_loghandle_t
Opaque log handle type.
Definition: log.h:138
bool cobaro_log_syslog_set(cobaro_loghandle_t lh)
Set the default log destination to be syslog.
void cobaro_log_fini(cobaro_loghandle_t lh)
Finalize the logging infrastructure.
Iterator useful.
Definition: log.h:70
struct cobaro_log::@0 p[COBARO_LOG_PARAM_MAX]
Array of parameters relevant to this log.
struct cobaro_log * next
Queue.
Definition: log.h:93
void cobaro_log_set_ipv4(cobaro_log_t log, int argnum, uint32_t source)
Helper function for setting an IPv4 parameter.
cobaro_log_t cobaro_log_next(cobaro_loghandle_t lh)
Receive a cobaro_log_t if available.
Critical conditions.
Definition: log.h:64
Log information structure.
Definition: log.h:82