stumpless  2.1.0
Macros
info.h File Reference
#include <stumpless/level/mask.h>
#include <stumpless/config.h>
#include <stumpless/log.h>
#include <stumpless/severity.h>
#include <stumpless/target.h>

Go to the source code of this file.

Macros

#define stump_i(...)
 Logs a message to the current target with informational severity. More...
 
#define stump_i_str(message)
 Logs a message to the current target with informational severity. More...
 
#define stump_i_entry(target, entry)   stumpless_add_entry( ( target ), ( entry ) )
 Adds an entry to a given target with informational severity. More...
 
#define stump_i_log(target, priority, ...)   stumpless_add_log( ( target ), ( priority ), __VA_ARGS__ )
 Adds a message to a given target with the specified priority. More...
 
#define stump_i_log_str(target, priority, message)   stumpless_add_log_str( ( target ), ( priority ), ( message ) )
 Adds a message to a given target with the specified priority. More...
 
#define stump_i_message(target, ...)
 Adds a message to a given target with informational severity. More...
 
#define stump_i_message_str(target, message)
 Adds a message to a given target with informational severity. More...
 
#define stumplog_i(priority, ...)   stumplog( ( priority ), __VA_ARGS__ )
 Adds a message to the current target with the specified priority. More...
 
#define stumplog_i_str(priority, message)   stumplog_str( ( priority ), ( message ) )
 Adds a message to the current target with the specified priority. More...
 

Detailed Description

Macro functions that log messages and entries at the informational level.

These can be turned into no-ops at compile time by defining STUMPLESS_DISABLE_INFO_LEVEL during build, or at least before inclusion of this header (or stumpless.h).

Macro Definition Documentation

◆ stump_i

#define stump_i (   ...)
Value:

Logs a message to the current target with informational severity.

This function will be removed at compile time if STUMPLESS_DISABLE_INFO_LEVEL has been defined during build. If it is disabled, then this function is removed at compile time and will have no effect. Otherwise, it is equivalent to a call to stumpless_add_log with the provided message and calculated priority.

Note that if this function is disabled, then the arguments will not be evaluated, meaning that any side effects will not happen. Be sure that any side effects you rely on will not cause problems if they are left out during a build with info level calls disabled.

This function will log the given message with a severity of STUMPLESS_SEVERITY_INFO, and the facility defined by the STUMPLESS_DEFAULT_FACILITY. If you wish to specify a different priority, then you will need to use stumplog_i instead.

The message must be a valid format specifier string provided along with the appropriate number of variable arguments afterwards. This means that it should not be a user-controlled value under any circumstances. If you need a safer alternative without the risks of format strings, use stump_i_str instead.

Thread Safety: MT-Safe This function is thread safe. Different target types handle thread safety differently, as some require per-target locks and others can rely on system libraries to log safely, but all targets support thread safe logging in some manner. For target-specific information on how thread safety is supported and whether AS or AC safety can be assumed, refer to the documentation for the target's header file (in the stumpless/target include folder).

Async Signal Safety: AS-Unsafe lock heap This function is not safe to call from signal handlers as some targets make use of non-reentrant locks to coordinate access. It also may make memory allocation calls to create internal cached structures, and memory allocation may not be signal safe.

Async Cancel Safety: AC-Unsafe lock heap This function is not safe to call from threads that may be asynchronously cancelled, due to the use of locks in some targets that could be left locked and the potential for memory allocation.

Parameters
messageThe message to log, optionally containing any format specifiers valid in printf. This must be a valid UTF-8 string in shortest form.
...Substitutions for any format specifiers provided in message. The number of substitutions provided must exactly match the number of specifiers given.
Returns
A non-negative value if no error is encountered. If an error is encountered, then a negative value is returned and an error code is set appropriately. If the function is disabled then the effective return value is zero, although a return value of zero does not guarantee that this function is disabled.

◆ stump_i_entry

#define stump_i_entry (   target,
  entry 
)    stumpless_add_entry( ( target ), ( entry ) )

Adds an entry to a given target with informational severity.

This function will be removed at compile time if STUMPLESS_DISABLE_INFO_LEVEL has been defined during build. If it is disabled, then this function is removed at compile time and will have no effect. Otherwise, it is equivalent to a call to stumplog with the provided message and calculated priority.

Note that if this function is disabled, then the arguments will not be evaluated, meaning that any side effects will not happen. Be sure that any side effects you rely on will not cause problems if they are left out during a build with info level calls disabled.

This call does not override the severity of the entry itself. Rather, it is intended to allow logging calls to be removed at compile time if the severity is known ahead of time.

Thread Safety: MT-Safe This function is thread safe. Different target types handle thread safety differently, as some require per-target locks and others can rely on system libraries to log safely, but all targets support thread safe logging in some manner. For target-specific information on how thread safety is supported and whether AS or AC safety can be assumed, refer to the documentation for the target's header file (in the stumpless/target include folder).

Async Signal Safety: AS-Unsafe lock This function is not safe to call from signal handlers as some targets make use of non-reentrant locks to coordinate access.

Async Cancel Safety: AC-Unsafe lock This function is not safe to call from threads that may be asynchronously cancelled, due to the use of locks in some targets that could be left locked.

Parameters
targetThe target to send the entry to.
entryThe entry to send to the target.
Returns
A non-negative value if no error is encountered. If an error is encountered, then a negative value is returned and an error code is set appropriately. If the function is disabled then the effective return value is zero, although a return value of zero does not guarantee that this function is disabled.

◆ stump_i_log

#define stump_i_log (   target,
  priority,
  ... 
)    stumpless_add_log( ( target ), ( priority ), __VA_ARGS__ )

Adds a message to a given target with the specified priority.

This function will be removed at compile time if STUMPLESS_DISABLE_INFO_LEVEL has been defined during build. If it is disabled, then this function is removed at compile time and will have no effect. Otherwise, it is equivalent to a call to stumplog with the provided message and calculated priority.

Note that if this function is disabled, then the arguments will not be evaluated, meaning that any side effects will not happen. Be sure that any side effects you rely on will not cause problems if they are left out during a build with info level calls disabled.

The message must be a valid format specifier string provided along with the appropriate number of variable arguments afterwards. This means that it should not be a user-controlled value under any circumstances. If you need a safer alternative without the risks of format strings, use stump_i_log_str instead.

Thread Safety: MT-Safe This function is thread safe. Different target types handle thread safety differently, as some require per-target locks and others can rely on system libraries to log safely, but all targets support thread safe logging in some manner. For target-specific information on how thread safety is supported and whether AS or AC safety can be assumed, refer to the documentation for the target's header file (in the stumpless/target include folder).

Async Signal Safety: AS-Unsafe lock heap This function is not safe to call from signal handlers as some targets make use of non-reentrant locks to coordinate access. It also may make memory allocation calls to create internal cached structures, and memory allocation may not be signal safe.

Async Cancel Safety: AC-Unsafe lock heap This function is not safe to call from threads that may be asynchronously cancelled, due to the use of locks in some targets that could be left locked and the potential for memory allocation.

Parameters
targetThe target to send the entry to.
priorityThe priority of the message - this should be the bitwise or of a single STUMPLESS_SEVERITY and single STUMPLESS_FACILITY value.
messageThe message to log, optionally containing any format specifiers valid in printf. This must be a valid UTF-8 string in shortest form.
...Substitutions for any format specifiers provided in message. The number of substitutions provided must exactly match the number of specifiers given.
Returns
A non-negative value if no error is encountered. If an error is encountered, then a negative value is returned and an error code is set appropriately. If the function is disabled then the effective return value is zero, although a return value of zero does not guarantee that this function is disabled.

◆ stump_i_log_str

#define stump_i_log_str (   target,
  priority,
  message 
)    stumpless_add_log_str( ( target ), ( priority ), ( message ) )

Adds a message to a given target with the specified priority.

This function will be removed at compile time if STUMPLESS_DISABLE_INFO_LEVEL has been defined during build. If it is disabled, then this function is removed at compile time and will have no effect. Otherwise, it is equivalent to a call to stumplog with the provided message and calculated priority.

Note that if this function is disabled, then the arguments will not be evaluated, meaning that any side effects will not happen. Be sure that any side effects you rely on will not cause problems if they are left out during a build with info level calls disabled.

Thread Safety: MT-Safe This function is thread safe. Different target types handle thread safety differently, as some require per-target locks and others can rely on system libraries to log safely, but all targets support thread safe logging in some manner. For target-specific information on how thread safety is supported and whether AS or AC safety can be assumed, refer to the documentation for the target's header file (in the stumpless/target include folder).

Async Signal Safety: AS-Unsafe lock heap This function is not safe to call from signal handlers as some targets make use of non-reentrant locks to coordinate access. It also may make memory allocation calls to create internal cached structures, and memory allocation may not be signal safe.

Async Cancel Safety: AC-Unsafe lock heap This function is not safe to call from threads that may be asynchronously cancelled, due to the use of locks in some targets that could be left locked and the potential for memory allocation.

Since
release v2.1.0.
Parameters
targetThe target to send the entry to.
priorityThe priority of the message - this should be the bitwise or of a single STUMPLESS_SEVERITY and single STUMPLESS_FACILITY value.
messageThe message to log. This must be a valid UTF-8 string in shortest form.
Returns
A non-negative value if no error is encountered. If an error is encountered, then a negative value is returned and an error code is set appropriately. If the function is disabled then the effective return value is zero, although a return value of zero does not guarantee that this function is disabled.

◆ stump_i_message

#define stump_i_message (   target,
  ... 
)
Value:

Adds a message to a given target with informational severity.

This function will be removed at compile time if STUMPLESS_DISABLE_INFO_LEVEL has been defined during build. If it is disabled, then this function is removed at compile time and will have no effect. Otherwise, it is equivalent to a call to stumpless_add_log with the provided message and calculated priority.

Note that if this function is disabled, then the arguments will not be evaluated, meaning that any side effects will not happen. Be sure that any side effects you rely on will not cause problems if they are left out during a build with info level calls disabled.

This function will log the given message with a severity of STUMPLESS_SEVERITY_INFO, and the facility defined by the STUMPLESS_DEFAULT_FACILITY. If you wish to specify a different priority, then you will need to use stump_i_log instead.

The message must be a valid format specifier string provided along with the appropriate number of variable arguments afterwards. This means that it should not be a user-controlled value under any circumstances. If you need a safer alternative without the risks of format strings, use stump_i_message_str instead.

Thread Safety: MT-Safe This function is thread safe. Different target types handle thread safety differently, as some require per-target locks and others can rely on system libraries to log safely, but all targets support thread safe logging in some manner. For target-specific information on how thread safety is supported and whether AS or AC safety can be assumed, refer to the documentation for the target's header file (in the stumpless/target include folder).

Async Signal Safety: AS-Unsafe lock heap This function is not safe to call from signal handlers as some targets make use of non-reentrant locks to coordinate access. It also may make memory allocation calls to create internal cached structures, and memory allocation may not be signal safe.

Async Cancel Safety: AC-Unsafe lock heap This function is not safe to call from threads that may be asynchronously cancelled, due to the use of locks in some targets that could be left locked and the potential for memory allocation.

Parameters
targetThe target to send the entry to.
messageThe message to log, optionally containing any format specifiers valid in printf. This must be a valid UTF-8 string in shortest form.
...Substitutions for any format specifiers provided in message. The number of substitutions provided must exactly match the number of specifiers given.
Returns
A non-negative value if no error is encountered. If an error is encountered, then a negative value is returned and an error code is set appropriately. If the function is disabled then the effective return value is zero, although a return value of zero does not guarantee that this function is disabled.

◆ stump_i_message_str

#define stump_i_message_str (   target,
  message 
)
Value:

Adds a message to a given target with informational severity.

This function will be removed at compile time if STUMPLESS_DISABLE_INFO_LEVEL has been defined during build. If it is disabled, then this function is removed at compile time and will have no effect. Otherwise, it is equivalent to a call to stumpless_add_log with the provided message and calculated priority.

Note that if this function is disabled, then the arguments will not be evaluated, meaning that any side effects will not happen. Be sure that any side effects you rely on will not cause problems if they are left out during a build with info level calls disabled.

This function will log the given message with a severity of STUMPLESS_SEVERITY_INFO, and the facility defined by the STUMPLESS_DEFAULT_FACILITY. If you wish to specify a different priority, then you will need to use stump_i_log instead.

Thread Safety: MT-Safe This function is thread safe. Different target types handle thread safety differently, as some require per-target locks and others can rely on system libraries to log safely, but all targets support thread safe logging in some manner. For target-specific information on how thread safety is supported and whether AS or AC safety can be assumed, refer to the documentation for the target's header file (in the stumpless/target include folder).

Async Signal Safety: AS-Unsafe lock heap This function is not safe to call from signal handlers as some targets make use of non-reentrant locks to coordinate access. It also may make memory allocation calls to create internal cached structures, and memory allocation may not be signal safe.

Async Cancel Safety: AC-Unsafe lock heap This function is not safe to call from threads that may be asynchronously cancelled, due to the use of locks in some targets that could be left locked and the potential for memory allocation.

Since
release v2.1.0.
Parameters
targetThe target to send the entry to.
messageThe message to log. This must be a valid UTF-8 string in shortest form.
Returns
A non-negative value if no error is encountered. If an error is encountered, then a negative value is returned and an error code is set appropriately. If the function is disabled then the effective return value is zero, although a return value of zero does not guarantee that this function is disabled.

◆ stump_i_str

#define stump_i_str (   message)
Value:

Logs a message to the current target with informational severity.

This function will be removed at compile time if STUMPLESS_DISABLE_INFO_LEVEL has been defined during build. If it is disabled, then this function is removed at compile time and will have no effect. Otherwise, it is equivalent to a call to stumpless_add_log with the provided message and calculated priority.

Note that if this function is disabled, then the arguments will not be evaluated, meaning that any side effects will not happen. Be sure that any side effects you rely on will not cause problems if they are left out during a build with info level calls disabled.

This function will log the given message with a severity of STUMPLESS_SEVERITY_INFO, and the facility defined by the STUMPLESS_DEFAULT_FACILITY. If you wish to specify a different priority, then you will need to use stumplog_i instead.

Thread Safety: MT-Safe This function is thread safe. Different target types handle thread safety differently, as some require per-target locks and others can rely on system libraries to log safely, but all targets support thread safe logging in some manner. For target-specific information on how thread safety is supported and whether AS or AC safety can be assumed, refer to the documentation for the target's header file (in the stumpless/target include folder).

Async Signal Safety: AS-Unsafe lock heap This function is not safe to call from signal handlers as some targets make use of non-reentrant locks to coordinate access. It also may make memory allocation calls to create internal cached structures, and memory allocation may not be signal safe.

Async Cancel Safety: AC-Unsafe lock heap This function is not safe to call from threads that may be asynchronously cancelled, due to the use of locks in some targets that could be left locked and the potential for memory allocation.

Since
release v2.1.0.
Parameters
messageThe message to log. This must be a valid UTF-8 string in shortest form.
Returns
A non-negative value if no error is encountered. If an error is encountered, then a negative value is returned and an error code is set appropriately. If the function is disabled then the effective return value is zero, although a return value of zero does not guarantee that this function is disabled.

◆ stumplog_i

#define stumplog_i (   priority,
  ... 
)    stumplog( ( priority ), __VA_ARGS__ )

Adds a message to the current target with the specified priority.

This function will be removed at compile time if STUMPLESS_DISABLE_INFO_LEVEL has been defined during build. If it is disabled, then this function is removed at compile time and will have no effect. Otherwise, it is equivalent to a call to stumplog with the provided message and calculated priority.

Note that if this function is disabled, then the arguments will not be evaluated, meaning that any side effects will not happen. Be sure that any side effects you rely on will not cause problems if they are left out during a build with info level calls disabled.

The message must be a valid format specifier string provided along with the appropriate number of variable arguments afterwards. This means that it should not be a user-controlled value under any circumstances. If you need a safer alternative without the risks of format strings, use stumplog_i_str instead.

Thread Safety: MT-Safe This function is thread safe. Different target types handle thread safety differently, as some require per-target locks and others can rely on system libraries to log safely, but all targets support thread safe logging in some manner. For target-specific information on how thread safety is supported and whether AS or AC safety can be assumed, refer to the documentation for the target's header file (in the stumpless/target include folder).

Async Signal Safety: AS-Unsafe lock heap This function is not safe to call from signal handlers as some targets make use of non-reentrant locks to coordinate access. It also may make memory allocation calls to create internal cached structures, and memory allocation may not be signal safe.

Async Cancel Safety: AC-Unsafe lock heap This function is not safe to call from threads that may be asynchronously cancelled, due to the use of locks in some targets that could be left locked and the potential for memory allocation.

Parameters
priorityThe priority of the message - this should be the bitwise or of a single STUMPLESS_SEVERITY and single STUMPLESS_FACILITY value.
messageThe message to log, optionally containing any format specifiers valid in printf. This must be a valid UTF-8 string in shortest form.
...Substitutions for any format specifiers provided in message. The number of substitutions provided must exactly match the number of specifiers given.

◆ stumplog_i_str

#define stumplog_i_str (   priority,
  message 
)    stumplog_str( ( priority ), ( message ) )

Adds a message to the current target with the specified priority.

This function will be removed at compile time if STUMPLESS_DISABLE_INFO_LEVEL has been defined during build. If it is disabled, then this function is removed at compile time and will have no effect. Otherwise, it is equivalent to a call to stumplog with the provided message and calculated priority.

Note that if this function is disabled, then the arguments will not be evaluated, meaning that any side effects will not happen. Be sure that any side effects you rely on will not cause problems if they are left out during a build with info level calls disabled.

Thread Safety: MT-Safe This function is thread safe. Different target types handle thread safety differently, as some require per-target locks and others can rely on system libraries to log safely, but all targets support thread safe logging in some manner. For target-specific information on how thread safety is supported and whether AS or AC safety can be assumed, refer to the documentation for the target's header file (in the stumpless/target include folder).

Async Signal Safety: AS-Unsafe lock heap This function is not safe to call from signal handlers as some targets make use of non-reentrant locks to coordinate access. It also may make memory allocation calls to create internal cached structures, and memory allocation may not be signal safe.

Async Cancel Safety: AC-Unsafe lock heap This function is not safe to call from threads that may be asynchronously cancelled, due to the use of locks in some targets that could be left locked and the potential for memory allocation.

Since
release v2.1.0.
Parameters
priorityThe priority of the message - this should be the bitwise or of a single STUMPLESS_SEVERITY and single STUMPLESS_FACILITY value.
messageThe message to log. This must be a valid UTF-8 string in shortest form.
stumpless_add_log_str
int stumpless_add_log_str(struct stumpless_target *target, int priority, const char *message)
Adds a log message with a priority to a given target.
STUMPLESS_DEFAULT_FACILITY
#define STUMPLESS_DEFAULT_FACILITY
The facility code to use when one is not supplied.
Definition: config.h:34
stumpless_add_log
int stumpless_add_log(struct stumpless_target *target, int priority, const char *message,...)
Adds a log message with a priority to a given target.
stumpless_get_current_target
struct stumpless_target * stumpless_get_current_target(void)
Gets the current target.
STUMPLESS_SEVERITY_INFO
@ STUMPLESS_SEVERITY_INFO
Informational: informational messages.
Definition: severity.h:186