libsir 2.2.6
Standard Incident Reporter
Loading...
Searching...
No Matches
sir.h
Go to the documentation of this file.
1
37#ifndef _SIR_H_INCLUDED
38# define _SIR_H_INCLUDED
39
40# include "sir/platform.h"
41# include "sir/version.h"
42# include "sir/types.h"
43
44# if defined(SWIG)
45# define PRINTF_FORMAT
46# define PRINTF_FORMAT_ATTR(fmt_p, va_p)
47# endif
48
49# if defined(__cplusplus)
50extern "C" {
51# endif
52
77bool sir_makeinit(sirinit* si);
78
99bool sir_init(sirinit* si);
100
115bool sir_cleanup(void);
116
130bool sir_isinitialized(void);
131
148uint16_t sir_geterror(char message[SIR_MAXERROR]);
149
164
188PRINTF_FORMAT_ATTR(1, 2)
189bool sir_debug(PRINTF_FORMAT const char* format, ...);
190
214PRINTF_FORMAT_ATTR(1, 2)
215bool sir_info(PRINTF_FORMAT const char* format, ...);
216
240PRINTF_FORMAT_ATTR(1, 2)
241bool sir_notice(PRINTF_FORMAT const char* format, ...);
242
266PRINTF_FORMAT_ATTR(1, 2)
267bool sir_warn(PRINTF_FORMAT const char* format, ...);
268
292PRINTF_FORMAT_ATTR(1, 2)
293bool sir_error(PRINTF_FORMAT const char* format, ...);
294
318PRINTF_FORMAT_ATTR(1, 2)
319bool sir_crit(PRINTF_FORMAT const char* format, ...);
320
344PRINTF_FORMAT_ATTR(1, 2)
345bool sir_alert(PRINTF_FORMAT const char* format, ...);
346
370PRINTF_FORMAT_ATTR(1, 2)
371bool sir_emerg(PRINTF_FORMAT const char* format, ...);
372
414sirfileid sir_addfile(const char* path, sir_levels levels, sir_options opts);
415
433bool sir_remfile(sirfileid id);
434
463sirpluginid sir_loadplugin(const char* path);
464
483
500bool sir_filelevels(sirfileid id, sir_levels levels);
501
519bool sir_fileopts(sirfileid id, sir_options opts);
520
542 sir_textcolor bg);
543
558bool sir_resettextstyles(void);
559
576
605
626bool sir_stdoutlevels(sir_levels levels);
627
648bool sir_stdoutopts(sir_options opts);
649
670bool sir_stderrlevels(sir_levels levels);
671
692bool sir_stderropts(sir_options opts);
693
715bool sir_sysloglevels(sir_levels levels);
716
734bool sir_syslogopts(sir_options opts);
735
760bool sir_syslogid(const char* identity);
761
788bool sir_syslogcat(const char* category);
789
805const char* sir_getversionstring(void);
806
814uint32_t sir_getversionhex(void);
815
822bool sir_isprerelease(void);
823
829# if defined(__cplusplus)
830}
831# endif
832
833#endif /* !_SIR_H_INCLUDED */
#define SIR_MAXERROR
The maximum size, in characters, of an error message.
Definition config.h:419
bool sir_stderropts(sir_options opts)
Set new formatting options for stderr.
Definition sir.c:211
bool sir_settextstyle(sir_level level, sir_textattr attr, sir_textcolor fg, sir_textcolor bg)
Set new text styling for stdio (stdout/stderr) destinations on a per-level basis.
Definition sir.c:170
sirpluginid sir_loadplugin(const char *path)
Loads a plugin module from disk.
Definition sir.c:140
bool sir_alert(PRINTF_FORMAT const char *format,...)
Dispatches a SIRL_ALERT level message.
Definition sir.c:117
bool sir_sysloglevels(sir_levels levels)
Set new level registrations for the system logger destination.
Definition sir.c:217
bool sir_setcolormode(sir_colormode mode)
Sets the ANSI color mode for stdio destinations.
Definition sir.c:189
bool sir_error(PRINTF_FORMAT const char *format,...)
Dispatches a SIRL_ERROR level message.
Definition sir.c:101
bool sir_notice(PRINTF_FORMAT const char *format,...)
Dispatches a SIRL_NOTICE level message.
Definition sir.c:85
bool sir_stderrlevels(sir_levels levels)
Set new level registrations for stderr.
Definition sir.c:205
sir_textcolor sir_makergb(sir_textcolor r, sir_textcolor g, sir_textcolor b)
Creates a sir_textcolor from red, green, and blue components.
Definition sir.c:185
bool sir_filelevels(sirfileid id, sir_levels levels)
Set new level registrations for a log file already managed by libsir.
Definition sir.c:158
bool sir_syslogopts(sir_options opts)
Set new formatting options for the system logger destination.
Definition sir.c:228
bool sir_unloadplugin(sirpluginid id)
Unloads a previously registered plugin module.
Definition sir.c:149
bool sir_stdoutlevels(sir_levels levels)
Set new level registrations for stdout.
Definition sir.c:193
uint32_t sir_getversionhex(void)
Returns the current libsir version as a number.
Definition sir.c:263
bool sir_debug(PRINTF_FORMAT const char *format,...)
Dispatches a SIRL_DEBUG level message.
Definition sir.c:69
bool sir_resettextstyles(void)
Reset text styling for stdio (stdout/stderr) destinations to their default values.
Definition sir.c:181
bool sir_info(PRINTF_FORMAT const char *format,...)
Dispatches a SIRL_INFO level message.
Definition sir.c:77
bool sir_cleanup(void)
Tears down and cleans up libsir after use.
Definition sir.c:52
sirfileid sir_addfile(const char *path, sir_levels levels, sir_options opts)
Adds a log file and registers it to receive log output.
Definition sir.c:132
bool sir_init(sirinit *si)
Initializes libsir for use.
Definition sir.c:48
bool sir_crit(PRINTF_FORMAT const char *format,...)
Dispatches a SIRL_CRIT level message.
Definition sir.c:109
bool sir_remfile(sirfileid id)
Removes a file previously added to libsir.
Definition sir.c:136
bool sir_syslogid(const char *identity)
Set new system logger identity.
Definition sir.c:239
bool sir_warn(PRINTF_FORMAT const char *format,...)
Dispatches a SIRL_WARN level message.
Definition sir.c:93
uint16_t sir_geterror(char message[SIR_MAXERROR])
Retrieves a formatted message for the last error that occurred on the calling thread and returns the ...
Definition sir.c:60
bool sir_stdoutopts(sir_options opts)
Set new formatting options for stdout.
Definition sir.c:199
bool sir_makeinit(sirinit *si)
Fills out a sirinit structure with default values.
Definition sir.c:44
bool sir_syslogcat(const char *category)
Set new system logger category.
Definition sir.c:249
bool sir_isinitialized(void)
Determines whether or not libsir is in the initialized state.
Definition sir.c:56
const char * sir_getversionstring(void)
Returns the current libsir version as a string.
Definition sir.c:259
void sir_geterrorinfo(sir_errorinfo *err)
Retrieves granular information about the last error that occurred on the calling thread.
Definition sir.c:64
bool sir_fileopts(sirfileid id, sir_options opts)
Set new formatting options for a log file already managed by libsir.
Definition sir.c:164
bool sir_isprerelease(void)
Whether or not this is a pre-release version of libsir.
Definition sir.c:267
bool sir_emerg(PRINTF_FORMAT const char *format,...)
Dispatches a SIRL_EMERG level message.
Definition sir.c:125
uint16_t sir_level
The sir_level type.
Definition types.h:71
uint32_t sirfileid
Log file identifier type.
Definition types.h:49
sir_textattr
Attributes for stdio output.
Definition types.h:107
sir_colormode
Color mode selection.
Definition types.h:99
uint16_t sir_levels
sir_level bitmask type.
Definition types.h:74
uint32_t sir_textcolor
stdio text color type.
Definition types.h:141
uint32_t sirpluginid
Plugin module identifier type.
Definition types.h:52
uint32_t sir_options
sir_option bitmask type.
Definition types.h:96
Information about an error that occurred.
Definition types.h:150
libsir initialization and configuration data.
Definition types.h:244