libsir 2.2.5
Standard Incident Reporter
Loading...
Searching...
No Matches
Collaboration diagram for Functions:

Functions

bool sir_makeinit (sirinit *si)
 Fills out a sirinit structure with default values.
 
bool sir_init (sirinit *si)
 Initializes libsir for use.
 
bool sir_cleanup (void)
 Tears down and cleans up libsir after use.
 
bool sir_isinitialized (void)
 Determines whether or not libsir is in the initialized state.
 
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 associated error code.
 
void sir_geterrorinfo (sir_errorinfo *err)
 Retrieves granular information about the last error that occurred on the calling thread.
 
bool sir_debug (PRINTF_FORMAT const char *format,...)
 Dispatches a SIRL_DEBUG level message.
 
bool sir_info (PRINTF_FORMAT const char *format,...)
 Dispatches a SIRL_INFO level message.
 
bool sir_notice (PRINTF_FORMAT const char *format,...)
 Dispatches a SIRL_NOTICE level message.
 
bool sir_warn (PRINTF_FORMAT const char *format,...)
 Dispatches a SIRL_WARN level message.
 
bool sir_error (PRINTF_FORMAT const char *format,...)
 Dispatches a SIRL_ERROR level message.
 
bool sir_crit (PRINTF_FORMAT const char *format,...)
 Dispatches a SIRL_CRIT level message.
 
bool sir_alert (PRINTF_FORMAT const char *format,...)
 Dispatches a SIRL_ALERT level message.
 
bool sir_emerg (PRINTF_FORMAT const char *format,...)
 Dispatches a SIRL_EMERG level message.
 
sirfileid sir_addfile (const char *path, sir_levels levels, sir_options opts)
 Adds a log file and registers it to receive log output.
 
bool sir_remfile (sirfileid id)
 Removes a file previously added to libsir.
 
sirpluginid sir_loadplugin (const char *path)
 Loads a plugin module from disk.
 
bool sir_unloadplugin (sirpluginid id)
 Unloads a previously registered plugin module.
 
bool sir_filelevels (sirfileid id, sir_levels levels)
 Set new level registrations for a log file already managed by libsir.
 
bool sir_fileopts (sirfileid id, sir_options opts)
 Set new formatting options for a log file already managed by libsir.
 
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.
 
bool sir_resettextstyles (void)
 Reset text styling for stdio (stdout/stderr) destinations to their default values.
 
sir_textcolor sir_makergb (sir_textcolor r, sir_textcolor g, sir_textcolor b)
 Creates a sir_textcolor from red, green, and blue components.
 
bool sir_setcolormode (sir_colormode mode)
 Sets the ANSI color mode for stdio destinations.
 
bool sir_stdoutlevels (sir_levels levels)
 Set new level registrations for stdout.
 
bool sir_stdoutopts (sir_options opts)
 Set new formatting options for stdout.
 
bool sir_stderrlevels (sir_levels levels)
 Set new level registrations for stderr.
 
bool sir_stderropts (sir_options opts)
 Set new formatting options for stderr.
 
bool sir_sysloglevels (sir_levels levels)
 Set new level registrations for the system logger destination.
 
bool sir_syslogopts (sir_options opts)
 Set new formatting options for the system logger destination.
 
bool sir_syslogid (const char *identity)
 Set new system logger identity.
 
bool sir_syslogcat (const char *category)
 Set new system logger category.
 
const char * sir_getversionstring (void)
 Returns the current libsir version as a string.
 
uint32_t sir_getversionhex (void)
 Returns the current libsir version as a number.
 
bool sir_isprerelease (void)
 Whether or not this is a pre-release version of libsir.
 

Detailed Description

Function Documentation

◆ sir_addfile()

sirfileid sir_addfile ( const char * path,
sir_levels levels,
sir_options opts )

Adds a log file and registers it to receive log output.

The file at path will be created if it does not exist, otherwise it will be appended to.

The levels for which the file will receive output are specified in the levels bitmask. If you wish to use the default levels, pass SIRL_DEFAULT.

The formatting options for the log output sent to the file are specified in the opts bitmask. If you wish to use the default options, pass SIRO_DEFAULT. By default, log files receive all available information.

Remarks
Take note of the SIR_FROLLSIZE compile-time constant. When any log file reaches that size in bytes, it will be archived to a date-stamped file in the same directory, and logging will resume at the path of the original file.
If path is a relative path, it shall be treated as relative to the current working directory. This is not necessarily the same directory that your application's binary file resides in.
The return value from this function is only valid for the lifetime of the process. If a crash or restart occurs, you will no longer be able to refer to the file by that identifier, and will have to add it again (libsir does not persist its log file cache).
To change the file's level registrations or options after adding it, call sir_filelevels and sir_fileopts, respectively.
See also
sir_remfile
Parameters
pathThe absolute or relative path of the file to become a logging destination for libsir.
levelsLevel registration bitmask.
optsFormatting options bitmask.
Returns
sirfileid If successful, a unique identifier that can later be used to modify level registrations, options, or remove the file from libsir. Upon failure, returns zero. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_alert()

bool sir_alert ( PRINTF_FORMAT const char * format,
... )

Dispatches a SIRL_ALERT level message.

The message will be delivered to all destinations registered to receive alert-level messages, each with their own formatting and styling options.

Remarks
To change options or level registrations for stdout/stderr, call sir_stdoutopts/sir_stdoutlevels and sir_stderropts/sir_stderrlevels, respectively. To change the text styling on a per-level basis, call sir_settextstyle.
See also
sir_level
sir_option
Defaults
Parameters
formatA printf-style format string, representing the template for the message to dispatch.
...Arguments whose type and position align with the format specifiers in format.
Returns
bool true if the message was dispatched successfully to all registered destinations, false otherwise. Call sir_geterror to obtain information about any error that may have occurred.

◆ sir_cleanup()

bool sir_cleanup ( void )

Tears down and cleans up libsir after use.

Deallocates resources such as memory buffers, file descriptors, etc. and resets the internal state. No calls into libsir will succeed after calling sir_cleanup (with the exception of sir_makeinit, sir_init, sir_isinitialized,sir_geterror, and sir_geterrorinfo).

May be called from any thread. If you wish to utilize libsir again during the same process' lifetime, simply call sir_init again.

Returns
bool true if cleanup was successful, false otherwise. Call sir_geterror to obtain information about any error that may have occurred.

◆ sir_crit()

bool sir_crit ( PRINTF_FORMAT const char * format,
... )

Dispatches a SIRL_CRIT level message.

The message will be delivered to all destinations registered to receive critical-level messages, each with their own formatting and styling options.

Remarks
To change options or level registrations for stdout/stderr, call sir_stdoutopts/sir_stdoutlevels and sir_stderropts/sir_stderrlevels, respectively. To change the text styling on a per-level basis, call sir_settextstyle.
See also
sir_level
sir_option
Defaults
Parameters
formatA printf-style format string, representing the template for the message to dispatch.
...Arguments whose type and position align with the format specifiers in format.
Returns
bool true if the message was dispatched successfully to all registered destinations, false otherwise. Call sir_geterror to obtain information about any error that may have occurred.

◆ sir_debug()

bool sir_debug ( PRINTF_FORMAT const char * format,
... )

Dispatches a SIRL_DEBUG level message.

The message will be delivered to all destinations registered to receive debug-level messages, each with their own formatting and styling options.

Remarks
To change options or level registrations for stdout/stderr, call sir_stdoutopts/sir_stdoutlevels and sir_stderropts/sir_stderrlevels, respectively. To change the text styling on a per-level basis, call sir_settextstyle.
See also
sir_level
sir_option
Defaults
Parameters
formatA printf-style format string, representing the template for the message to dispatch.
...Arguments whose type and position align with the format specifiers in format.
Returns
bool true if the message was dispatched successfully to all registered destinations, false otherwise. Call sir_geterror to obtain information about any error that may have occurred.

◆ sir_emerg()

bool sir_emerg ( PRINTF_FORMAT const char * format,
... )

Dispatches a SIRL_EMERG level message.

The message will be delivered to all destinations registered to receive emergency-level messages, each with their own formatting and styling options.

Remarks
To change options or level registrations for stdout/stderr, call sir_stdoutopts/sir_stdoutlevels and sir_stderropts/sir_stderrlevels, respectively. To change the text styling on a per-level basis, call sir_settextstyle.
See also
sir_level
sir_option
Defaults
Parameters
formatA printf-style format string, representing the template for the message to dispatch.
...Arguments whose type and position align with the format specifiers in format.
Returns
bool true if the message was dispatched successfully to all registered destinations, false otherwise. Call sir_geterror to obtain information about any error that may have occurred.

◆ sir_error()

bool sir_error ( PRINTF_FORMAT const char * format,
... )

Dispatches a SIRL_ERROR level message.

The message will be delivered to all destinations registered to receive error-level messages, each with their own formatting and styling options.

Remarks
To change options or level registrations for stdout/stderr, call sir_stdoutopts/sir_stdoutlevels and sir_stderropts/sir_stderrlevels, respectively. To change the text styling on a per-level basis, call sir_settextstyle.
See also
sir_level
sir_option
Defaults
Parameters
formatA printf-style format string, representing the template for the message to dispatch.
...Arguments whose type and position align with the format specifiers in format.
Returns
bool true if the message was dispatched successfully to all registered destinations, false otherwise. Call sir_geterror to obtain information about any error that may have occurred.

◆ sir_filelevels()

bool sir_filelevels ( sirfileid id,
sir_levels levels )

Set new level registrations for a log file already managed by libsir.

By default, log files are registered for the following levels:

  • all levels (SIRL_ALL)
See also
sir_fileopts
Parameters
idThe sirfileid obtained when the file was added to libsir.
levelsNew bitmask of sir_level to register for. If you wish to use the default levels, pass SIRL_DEFAULT.
Returns
bool true if the file is known to libsir and was successfully updated, false otherwise. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_fileopts()

bool sir_fileopts ( sirfileid id,
sir_options opts )

Set new formatting options for a log file already managed by libsir.

By default, log files have the following formatting options:

See also
sir_filelevels
Parameters
idThe sirfileid obtained when the file was added to libsir.
optsNew bitmask of sir_option for the file. If you wish to use the default options, pass SIRO_DEFAULT.
Returns
bool true if the file is known to libsir and was successfully updated, false otherwise. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_geterror()

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 associated error code.

To retrieve more granular information about an error, or to customize the error message format, use sir_geterrorinfo.

Remarks
libsir maintains errors on a per-thread basis, so it's important that the same thread that encountered a failed library call be the one to retrieve the error message.
Parameters
messageA buffer of SIR_MAXERROR chars into which the error message is placed.
Returns
uint16_t An error code (see sir_errorcode). Returns SIR_E_NOERROR if no error has occurred.

◆ sir_geterrorinfo()

void sir_geterrorinfo ( sir_errorinfo * err)

Retrieves granular information about the last error that occurred on the calling thread.

To retrieve just an error code and a formatted message, use sir_geterror.

Remarks
libsir maintains errors on a per-thread basis, so it's important that the same thread that encountered a failed library call be the one to retrieve the error message.
Parameters
errPointer to a sir_errorinfo structure into which the error infor- mation is placed.

◆ sir_getversionhex()

uint32_t sir_getversionhex ( void )

Returns the current libsir version as a number.

Note
Can be formatted as a hexadecimal number with %08x.
Returns
uint32_t The current libsir version number.

◆ sir_getversionstring()

const char * sir_getversionstring ( void )

Returns the current libsir version as a string.

Note
This may be helpful when using libsir as a shared library-it will always return the value of the shared library, not the source version of libsir that you built against.

Example:

2.2.5-dev
Returns
const char* The current libsir version string.

◆ sir_info()

bool sir_info ( PRINTF_FORMAT const char * format,
... )

Dispatches a SIRL_INFO level message.

The message will be delivered to all destinations registered to receive information-level messages, each with their own formatting and styling options.

Remarks
To change options or level registrations for stdout/stderr, call sir_stdoutopts/sir_stdoutlevels and sir_stderropts/sir_stderrlevels, respectively. To change the text styling on a per-level basis, call sir_settextstyle.
See also
sir_level
sir_option
Defaults
Parameters
formatA printf-style format string, representing the template for the message to dispatch.
...Arguments whose type and position align with the format specifiers in format.
Returns
bool true if the message was dispatched successfully to all registered destinations, false otherwise. Call sir_geterror to obtain information about any error that may have occurred.

◆ sir_init()

bool sir_init ( sirinit * si)

Initializes libsir for use.

Must be called before making any other calls into libsir (with the exception of sir_makeinit).

For every call to sir_init, there must be a corresponding call to sir_cleanup. All exported libsir functions are thread-safe, so you may initialize and cleanup on whichever thread you wish.

See also
sir_makeinit
sir_cleanup
Parameters
siPointer to a sirinit structure containing the desired settings and configuration. libsir makes a copy of this structure, so its lifetime is not a concern.
Returns
bool true if initialization was successful, false otherwise. Call sir_geterror to obtain information about any error that may have occurred.

◆ sir_isinitialized()

bool sir_isinitialized ( void )

Determines whether or not libsir is in the initialized state.

Provided as a convenience method to detect whether libsir requires initial- ization or cleanup at any given time.

Remarks
Calling sir_init after libsir is initialized produces an error. Similarly, sir_cleanup behaves the same way if libsir is not initialized.
Returns
bool true if sir_init has been called and libsir is initialized; false if sir_init has not yet been called, or a corresponding call to sir_cleanup has already been made.

◆ sir_isprerelease()

bool sir_isprerelease ( void )

Whether or not this is a pre-release version of libsir.

Returns
bool true if this is a pre-release version of libsir (i.e., not a public release), false if this is a public release version.

◆ sir_loadplugin()

sirpluginid sir_loadplugin ( const char * path)

Loads a plugin module from disk.

Loads, queries, validates, and initializes a libsir plugin module. If loading and validation are successful, the plugin is registered in the internal cache.

After that point in time, the plugin will be notified upon the dispatching of log messages on any sir_level the plugin registered for when it was loaded.

Remarks
If path is a relative path, it shall be treated as relative to the current working directory. This is not necessarily the same directory that your application's binary file resides in.
The return value from this function is only valid for the lifetime of the process. If a crash or restart occurs, you will no longer be able to refer to the plugin by that identifier, and will have to load it again (libsir does not persist its plugin cache).
See also
sir_unloadplugin
Plugins
Parameters
pathThe absolute or relative path of the plugin to be loaded and registered.
Returns
sirpluginid If successful, a unique identifier that may later be used to unload the plugin module. Upon failure, returns zero. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_makeinit()

bool sir_makeinit ( sirinit * si)

Fills out a sirinit structure with default values.

Creates an initialization configuration for libsir essentially using all of the default values (i.e., level registrations, formatting options, and text styling).

Note
Does not fill in string fields, such as sirinit.name.
Parameters
siPointer to a sirinit structure to receive default values.
Returns
bool true if si is not NULL, false otherwise.

◆ sir_makergb()

Creates a sir_textcolor from red, green, and blue components.

Note
Use this function to create colors suitable for sir_settextstyle when using RGB color mode.
See also
sir_setcolormode
sir_settextstyle
Defaults
Parameters
rThe red component (0..255)
gThe green component (0..255)
bThe blue component (0..255)
Returns
sir_textcolor The color created by combining the r, g, and b components.

◆ sir_notice()

bool sir_notice ( PRINTF_FORMAT const char * format,
... )

Dispatches a SIRL_NOTICE level message.

The message will be delivered to all destinations registered to receive notice-level messages, each with their own formatting and styling options.

Remarks
To change options or level registrations for stdout/stderr, call sir_stdoutopts/sir_stdoutlevels and sir_stderropts/sir_stderrlevels, respectively. To change the text styling on a per-level basis, call sir_settextstyle.
See also
sir_level
sir_option
Defaults
Parameters
formatA printf-style format string, representing the template for the message to dispatch.
...Arguments whose type and position align with the format specifiers in format.
Returns
bool true if the message was dispatched successfully to all registered destinations, false otherwise. Call sir_geterror to obtain information about any error that may have occurred.

◆ sir_remfile()

bool sir_remfile ( sirfileid id)

Removes a file previously added to libsir.

Immediately causes the file represented by id (the value returned from sir_addfile) to be removed from libsir, and its file descriptor closed.

Its contents will remain intact, and any pending writes will be flushed to the file before it is closed.

See also
sir_filelevels
sir_fileopts
Parameters
idThe sirfileid obtained when the file was added to libsir.
Returns
bool true if the file is known to libsir and was successfully removed, false otherwise. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_resettextstyles()

bool sir_resettextstyles ( void )

Reset text styling for stdio (stdout/stderr) destinations to their default values.

Note
The text styling will be applied according to the current color mode (as previously set by sir_setcolormode, or by default, 16-color mode).
See also
sir_setcolormode
sir_settextstyle
Defaults
Returns
bool true if successfully reset, false otherwise. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_setcolormode()

bool sir_setcolormode ( sir_colormode mode)

Sets the ANSI color mode for stdio destinations.

Note
Some terminals may not support the color modes offered by libsir, so make sure everything looks right after changing the mode.
When you change the color mode, all previously set text styles will be reset to their defaults. You will have to reapply any text styles set before this call.

The available modes are:

  • SIRCM_16: 4-bit, 16-color mode. Colors are defined by the SIRTC_* values. This is the default mode.
  • SIRCM_256: 8-bit, 256-color mode. Colors are defined by numeric value (0..255)
  • SIRCM_RGB: 24-bit RGB color mode. Colors are defined by numeric value, with red, green, and blue components (0..255) each.
See also
sir_makergb
sir_settextstyle
Defaults
Parameters
modeOne of the SIRCM_* constants, defining the mode to use.
Returns
bool true if the color mode was changed successfully, false otherwise. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_settextstyle()

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.

See also
sir_setcolormode
sir_resettextstyles
Defaults
Note
Use SIRTC_DEFAULT to get the default foreground or background color. To set colors in RGB color mode, use sir_makergb to create the foreground and background colors.
Parameters
levelThe sir_level for which to set the text styling.
attrThe sir_textattr attributes to apply to the text.
fgThe foreground color to apply to the text.
bgThe background color to apply to the text.
Returns
bool true if successfully updated, false otherwise. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_stderrlevels()

bool sir_stderrlevels ( sir_levels levels)

Set new level registrations for stderr.

By default, stderr is registered for the following levels:

  • error (SIRL_ERROR)
  • critical (SIRL_CRIT)
  • alert (SIRL_ALERT)
  • emergency (SIRL_EMERG)

To modify formatting options for stderr, use sir_stderropts.

See also
sir_stderropts
Parameters
levelsNew bitmask of sir_level to register for. If you wish to use the default levels, pass SIRL_DEFAULT.
Returns
bool true if successfully updated, false otherwise. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_stderropts()

bool sir_stderropts ( sir_options opts)

Set new formatting options for stderr.

By default, stderr has the following formatting options:

To modify level registrations for stderr, use sir_stderrlevels.

See also
sir_stderrlevels
Parameters
optsNew bitmask of sir_option for stderr. If you wish to use the default values, pass SIRL_DEFAULT.
Returns
bool true if successfully updated, false otherwise. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_stdoutlevels()

bool sir_stdoutlevels ( sir_levels levels)

Set new level registrations for stdout.

By default, stdout is registered for the following levels:

  • debug (SIRL_DEBUG)
  • info (SIRL_INFO)
  • notice (SIRL_NOTICE)
  • warning (SIRL_WARN)

To modify formatting options for stdout, use sir_stdoutopts.

See also
sir_stdoutopts
Parameters
levelsNew bitmask of sir_level to register for. If you wish to use the default levels, pass SIRL_DEFAULT.
Returns
bool true if successfully updated, false otherwise. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_stdoutopts()

bool sir_stdoutopts ( sir_options opts)

Set new formatting options for stdout.

By default, stdout has the following formatting options:

To modify level registrations for stdout, use sir_stdoutlevels.

See also
sir_stdoutlevels
Parameters
optsNew bitmask of sir_option for stdout. If you wish to use the default values, pass SIRL_DEFAULT.
Returns
bool true if successfully updated, false otherwise. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_syslogcat()

bool sir_syslogcat ( const char * category)

Set new system logger category.

Some system logger facilities (e.g. os_log, the system logger on macOS), ask for a category string when logging messages-to more easily group messages together (which, as a byproduct, enhances searching).

If you are not utilizing a system logger that requires a category string, you do not need to call this function (or set sirinit.d_syslog.category).

Upon library initialization, the system logger category is resolved as follows:

  1. If the sirinit.d_syslog.category string is set, it will be used.
  2. The string SIR_FALLBACK_SYSLOG_CAT will be used.
Remarks
If SIR_NO_SYSTEM_LOGGERS is defined when compiling libsir, this function will immediately return false, and set the last error to SIR_E_UNAVAIL.
Parameters
categoryThe string to use as the system logger category.
Returns
bool true if successfully updated, false otherwise. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_syslogid()

bool sir_syslogid ( const char * identity)

Set new system logger identity.

In the context of the system logger (i.e., syslog/os_log/etc.), identity refers to the name that appears in the log for the current process.

Upon library initialization, the system logger identity is resolved as follows:

  1. If the sirinit.d_syslog.identity string is set, it will be used.
  2. If the sirinit.name string is set, it will be used.
  3. If the name of the current process is available, it will be used.
  4. If none of these are available, the string SIR_FALLBACK_SYSLOG_ID will be used.
Remarks
If SIR_NO_SYSTEM_LOGGERS is defined when compiling libsir, this function will immediately return false, and set the last error to SIR_E_UNAVAIL.
Parameters
identityThe string to use as the system logger identity.
Returns
bool true if successfully updated, false otherwise. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_sysloglevels()

bool sir_sysloglevels ( sir_levels levels)

Set new level registrations for the system logger destination.

By default, the system logger is registered for the following levels:

  • notice (SIRL_NOTICE)
  • warning (SIRL_WARNING)
  • error (SIRL_ERROR)
  • critical (SIRL_CRIT)
  • emergency (SIRL_EMERG)

To modify formatting options for the system logger, use sir_syslogopts.

See also
sir_syslogopts
Parameters
levelsNew bitmask of sir_level to register for. If you wish to use the default levels, pass SIRL_DEFAULT.
Returns
bool true if successfully updated, false otherwise. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_syslogopts()

bool sir_syslogopts ( sir_options opts)

Set new formatting options for the system logger destination.

By default, the system logger has the following formatting options:

To modify level registrations for the system logger, use sir_sysloglevels.

See also
sir_sysloglevels
Parameters
optsNew bitmask of sir_option for the system logger. If you wish to use the default values, pass SIRO_DEFAULT.
Returns
bool true if successfully updated, false otherwise. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_unloadplugin()

bool sir_unloadplugin ( sirpluginid id)

Unloads a previously registered plugin module.

Cleans up, de-registers, and unloads a plugin represented by id (the value returned from sir_loadplugin).

If the plugin is located in the cache, it is instructed to clean up and prepare to be unloaded. Upon completion of the plugin's clean up routine, it is unloaded.

See also
sir_loadplugin
Plugins
Parameters
idThe sirpluginid obtained when the plugin was loaded.
Returns
bool true if the plugin was located and successfully unloaded,false otherwise. Use sir_geterror to obtain information about any error that may have occurred.

◆ sir_warn()

bool sir_warn ( PRINTF_FORMAT const char * format,
... )

Dispatches a SIRL_WARN level message.

The message will be delivered to all destinations registered to receive warning-level messages, each with their own formatting and styling options.

Remarks
To change options or level registrations for stdout/stderr, call sir_stdoutopts/sir_stdoutlevels and sir_stderropts/sir_stderrlevels, respectively. To change the text styling on a per-level basis, call sir_settextstyle.
See also
sir_level
sir_option
Defaults
Parameters
formatA printf-style format string, representing the template for the message to dispatch.
...Arguments whose type and position align with the format specifiers in format.
Returns
bool true if the message was dispatched successfully to all registered destinations, false otherwise. Call sir_geterror to obtain information about any error that may have occurred.