CAPS Universe documentation  1.0.4
All you need to know to be successful
Macros | Functions | Variables
libcapsbase.c File Reference

Common API for all other CAPS libraries. More...

Macros

#define LIBCAPS_VERBOSITY_DEFAULT   LIBCAPS_WARN
 

Functions

void caps_terminate (int rc)
 
static void _caps_terminate (int rc)
 
void caps_developers_failure_report_and_terminate (const char *scope, const char *fn, int ln, const char *message)
 
void caps_memory_failure_report_and_terminate (const char *scope, const char *fn, int ln)
 
static void journald_detect (void)
 
void caps_libbase_init (void)
 
void caps_libbase_version_get (unsigned *major, unsigned *minor, unsigned *micro)
 
void caps_message_stream_set (FILE *stream)
 
void caps_message_print (enum caps_verbosity level, const char *scope, const char *fn, int ln, const char *format,...)
 
void caps_verbosity_level_set (enum caps_verbosity new_level, bool overwrite)
 

Variables

static enum caps_verbosity verbosity_level = LIBCAPS_WARN
 
static FILE * output_stream
 
static char * td
 

Detailed Description

Author
Jürgen Borleis
Note
The global API you can find here: libcapsbase: API description

Macro Definition Documentation

◆ LIBCAPS_VERBOSITY_DEFAULT

#define LIBCAPS_VERBOSITY_DEFAULT   LIBCAPS_WARN

The default verbosity level, when caps_libbase_init() is called. Its verbosity level was defined when the libcapsbase was built.
It can be overwritten at run-time via the CAPS_START_VERBOSITY environment variable, to enable early debug for example.

Function Documentation

◆ _caps_terminate()

static void _caps_terminate ( int  rc)
static

Terminate the calling process

Parameters
[in]rcReturn value for the shell

Internal termination function without stack trace like the caps_terminate()

Note
This function does not return.
Exits or aborts the calling process (refer Abort or Exit Choice for details)
The rc is used in the exit() case only

◆ journald_detect()

static void journald_detect ( void  )
static

Detect if we are running attached to systemd's journald.

If its the case, upgrade the logging protocol

Note
This is only optional

Variable Documentation

◆ verbosity_level

enum caps_verbosity verbosity_level = LIBCAPS_WARN
static

The current verbosity level to output. All messages with a higher level will be dropped

◆ output_stream

FILE* output_stream
static

The current stream to output messages to.

◆ td

char* td
static