Get information about a log file
Synopsis:
#include <slog2_parse.h>
int slog2_get_log_info( slog2_log_t log,
slog2_log_info_t *log_info );
Arguments:
- log
- A log handle previously returned by
slog2_open_log().
- log_info
- A pointer to a slog2_log_info structure where the function can store the information
about the log.
Library:
libslog2parse
Use the -l slog2parse option to
qcc
to link against this library.
Description:
The slog2_get_log_info() function gets information about a log file and stores it in
the given slog2_log_info structure.
Note:
Before you call this function, you must use the
SLOG2_LOG_INFO_INIT macro to
initialize the
slog2_log_info structure.
For example:
slog2_log_info_t log_info = SLOG2_LOG_INFO_INIT;
The slog2_log_info structure is defined as follows:
typedef struct {
uint32_t size;
uint32_t num_buffers;
uint32_t owner_pid;
const char *buffer_set_name;
uint8_t verbosity_level;
} slog2_log_info_t;
The members include:
- size
- The size of the structure, which is used to determine the version of the software.
- num_buffers
- The number of buffers contained in this log.
- owner_pid
- The process ID of the creator of the log.
- buffer_set_name
- The descriptive name of this log.
Don't modify the string that this member points to.
- verbosity_level
- The global verbosity level of the log; one of the following (defined in <sys/slog2.h>):
- SLOG2_SHUTDOWN
- SLOG2_CRITICAL
- SLOG2_ERROR
- SLOG2_WARNING
- SLOG2_NOTICE
- SLOG2_INFO
- SLOG2_DEBUG1
- SLOG2_DEBUG2
For more information, see the entry for
slog2_register().
Returns:
0 on success, or -1 if an error occurred.
Classification:
QNX Neutrino
Safety: |
|
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |