logconfig.c
Go to the documentation of this file.
/*
* Copyright (c) 2002-2005 MontaVista Software, Inc.
* Copyright (c) 2006-2011 Red Hat, Inc.
*
* All rights reserved.
*
* Author: Steven Dake (sdake@redhat.com)
* Jan Friesse (jfriesse@redhat.com)
*
* This software licensed under BSD license, the text of which follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of the MontaVista Software, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include <corosync/totem/totem.h>
#include <corosync/logsys.h>
#ifdef LOGCONFIG_USE_ICMAP
#include <corosync/icmap.h>
#define MAP_KEYNAME_MAXLEN ICMAP_KEYNAME_MAXLEN
#define map_get_string(key_name, value) icmap_get_string(key_name, value)
#else
#include <corosync/cmap.h>
static cmap_handle_t cmap_handle;
static const char *main_logfile;
#define MAP_KEYNAME_MAXLEN CMAP_KEYNAME_MAXLEN
#define map_get_string(key_name, value) cmap_get_string(cmap_handle, key_name, value)
#endif
#include "util.h"
#include "logconfig.h"
#include "totemknet.h"
static char error_string_response[512];
static int insert_into_buffer(
char *target_buffer,
size_t bufferlen,
const char *entry,
const char *after)
{
const char *current_format = NULL;
current_format = logsys_format_get();
/* if the entry is already in the format we don't add it again */
if (strstr(current_format, entry) != NULL) {
return -1;
}
/* if there is no "after", simply prepend the requested entry
* otherwise go for beautiful string manipulation.... </sarcasm> */
if (!after) {
if (snprintf(target_buffer, bufferlen - 1, "%s%s",
entry,
current_format) >= bufferlen - 1) {
return -1;
}
} else {
const char *afterpos;
size_t afterlen;
size_t templen;
/* check if after is contained in the format
* and afterlen has a meaning or return an error */
afterpos = strstr(current_format, after);
afterlen = strlen(after);
if ((!afterpos) || (!afterlen)) {
return -1;
}
templen = afterpos - current_format + afterlen;
if (snprintf(target_buffer, templen + 1, "%s", current_format)
>= bufferlen - 1) {
return -1;
}
if (snprintf(target_buffer + templen, bufferlen - ( templen + 1 ),
"%s%s", entry, current_format + templen)
>= bufferlen - ( templen + 1 )) {
return -1;
}
}
return 0;
}
/*
* format set is global specific option that
* doesn't apply at system/subsystem level.
*/
static int corosync_main_config_format_set (
const char **error_string)
{
const char *error_reason;
char new_format_buffer[PATH_MAX];
char *value = NULL;
int err = 0;
char timestamp_str_to_add[8];
if (map_get_string("logging.fileline", &value) == CS_OK) {
if (strcmp (value, "on") == 0) {
if (!insert_into_buffer(new_format_buffer,
sizeof(new_format_buffer),
" %f:%l", "g]")) {
err = logsys_format_set(new_format_buffer);
} else
if (!insert_into_buffer(new_format_buffer,
sizeof(new_format_buffer),
"%f:%l", NULL)) {
err = logsys_format_set(new_format_buffer);
}
} else
if (strcmp (value, "off") == 0) {
/* nothing to do here */
} else {
error_reason = "unknown value for fileline";
free(value);
goto parse_error;
}
free(value);
}
if (err) {
error_reason = "not enough memory to set logging format buffer";
goto parse_error;
}
if (map_get_string("logging.function_name", &value) == CS_OK) {
if (strcmp (value, "on") == 0) {
if (!insert_into_buffer(new_format_buffer,
sizeof(new_format_buffer),
"%n:", "f:")) {
err = logsys_format_set(new_format_buffer);
} else
if (!insert_into_buffer(new_format_buffer,
sizeof(new_format_buffer),
" %n", "g]")) {
err = logsys_format_set(new_format_buffer);
}
} else
if (strcmp (value, "off") == 0) {
/* nothing to do here */
} else {
error_reason = "unknown value for function_name";
free(value);
goto parse_error;
}
free(value);
}
if (err) {
error_reason = "not enough memory to set logging format buffer";
goto parse_error;
}
memset(timestamp_str_to_add, 0, sizeof(timestamp_str_to_add));
if (map_get_string("logging.timestamp", &value) == CS_OK) {
if (strcmp (value, "on") == 0) {
strcpy(timestamp_str_to_add, "%t");
#ifdef QB_FEATURE_LOG_HIRES_TIMESTAMPS
} else if (strcmp (value, "hires") == 0) {
strcpy(timestamp_str_to_add, "%T");
#endif
} else if (strcmp (value, "off") == 0) {
/* nothing to do here */
} else {
error_reason = "unknown value for timestamp";
free(value);
goto parse_error;
}
free(value);
} else {
/*
* Display hires timestamp by default, otherwise standard timestamp
*/
#ifdef QB_FEATURE_LOG_HIRES_TIMESTAMPS
strcpy(timestamp_str_to_add, "%T");
#else
strcpy(timestamp_str_to_add, "%t");
#endif
}
if(strcmp(timestamp_str_to_add, "") != 0) {
strcat(timestamp_str_to_add, " ");
if (insert_into_buffer(new_format_buffer, sizeof(new_format_buffer),
timestamp_str_to_add, NULL) == 0) {
err = logsys_format_set(new_format_buffer);
}
}
if (err) {
error_reason = "not enough memory to set logging format buffer";
goto parse_error;
}
return (0);
parse_error:
*error_string = error_reason;
return (-1);
}
/*
* blackbox is another global specific option that
* doesn't apply at system/subsystem level.
*/
static int corosync_main_config_blackbox_set (
const char **error_string)
{
const char *error_reason;
char *value = NULL;
if (map_get_string("logging.blackbox", &value) == CS_OK) {
if (strcmp (value, "on") == 0) {
(void)logsys_blackbox_set(QB_TRUE);
} else if (strcmp (value, "off") == 0) {
(void)logsys_blackbox_set(QB_FALSE);
} else {
error_reason = "unknown value for blackbox";
free(value);
goto parse_error;
}
free(value);
} else {
(void)logsys_blackbox_set(QB_TRUE);
}
return (0);
parse_error:
*error_string = error_reason;
return (-1);
}
static int corosync_main_config_log_destination_set (
const char *path,
const char *key,
const char *subsys,
const char **error_string,
unsigned int mode_mask,
char deprecated,
char default_value,
const char *replacement)
{
static char formatted_error_reason[128];
char *value = NULL;
unsigned int mode;
char key_name[MAP_KEYNAME_MAXLEN];
snprintf(key_name, MAP_KEYNAME_MAXLEN, "%s.%s", path, key);
if (map_get_string(key_name, &value) == CS_OK) {
if (deprecated) {
log_printf(LOGSYS_LEVEL_WARNING,
"Warning: the %s config parameter has been obsoleted."
" See corosync.conf man page %s directive.",
key, replacement);
}
mode = logsys_config_mode_get (subsys);
if (strcmp (value, "yes") == 0 || strcmp (value, "on") == 0) {
mode |= mode_mask;
if (logsys_config_mode_set(subsys, mode) < 0) {
sprintf (formatted_error_reason, "unable to set mode %s", key);
goto parse_error;
}
} else
if (strcmp (value, "no") == 0 || strcmp (value, "off") == 0) {
mode &= ~mode_mask;
if (logsys_config_mode_set(subsys, mode) < 0) {
sprintf (formatted_error_reason, "unable to unset mode %s", key);
goto parse_error;
}
} else {
sprintf (formatted_error_reason, "unknown value for %s", key);
goto parse_error;
}
}
/* Set to default if we are the top-level logger */
else if (!subsys && !deprecated) {
mode = logsys_config_mode_get (subsys);
if (default_value) {
mode |= mode_mask;
}
else {
mode &= ~mode_mask;
}
if (logsys_config_mode_set(subsys, mode) < 0) {
sprintf (formatted_error_reason, "unable to change mode %s", key);
goto parse_error;
}
}
free(value);
return (0);
parse_error:
*error_string = formatted_error_reason;
free(value);
return (-1);
}
static int corosync_main_config_set (
const char *path,
const char *subsys,
const char **error_string)
{
const char *error_reason = error_string_response;
char *value = NULL;
int mode;
char key_name[MAP_KEYNAME_MAXLEN];
/*
* this bit abuses the internal logsys exported API
* to guarantee that all configured subsystems are
* initialized too.
*
* using this approach avoids some headaches caused
* by IPC and TOTEM that have a special logging
* handling requirements
*/
if (subsys != NULL) {
if (_logsys_subsys_create(subsys, NULL) < 0) {
error_reason = "unable to create new logging subsystem";
goto parse_error;
}
}
mode = logsys_config_mode_get(subsys);
if (mode < 0) {
error_reason = "unable to get mode";
goto parse_error;
}
if (corosync_main_config_log_destination_set (path, "to_stderr", subsys, &error_reason,
LOGSYS_MODE_OUTPUT_STDERR, 0, 1, NULL) != 0)
goto parse_error;
if (corosync_main_config_log_destination_set (path, "to_syslog", subsys, &error_reason,
LOGSYS_MODE_OUTPUT_SYSLOG, 0, 1, NULL) != 0)
goto parse_error;
snprintf(key_name, MAP_KEYNAME_MAXLEN, "%s.%s", path, "syslog_facility");
if (map_get_string(key_name, &value) == CS_OK) {
int syslog_facility;
syslog_facility = qb_log_facility2int(value);
if (syslog_facility < 0) {
error_reason = "unknown syslog facility specified";
goto parse_error;
}
if (logsys_config_syslog_facility_set(subsys,
syslog_facility) < 0) {
error_reason = "unable to set syslog facility";
goto parse_error;
}
free(value);
}
else {
/* Set default here in case of a reload */
if (logsys_config_syslog_facility_set(subsys,
qb_log_facility2int("daemon")) < 0) {
error_reason = "unable to set syslog facility";
goto parse_error;
}
}
snprintf(key_name, MAP_KEYNAME_MAXLEN, "%s.%s", path, "syslog_level");
if (map_get_string(key_name, &value) == CS_OK) {
int syslog_priority;
log_printf(LOGSYS_LEVEL_WARNING,
"Warning: the syslog_level config parameter has been obsoleted."
" See corosync.conf man page syslog_priority directive.");
syslog_priority = logsys_priority_id_get(value);
free(value);
if (syslog_priority < 0) {
error_reason = "unknown syslog level specified";
goto parse_error;
}
if (logsys_config_syslog_priority_set(subsys,
syslog_priority) < 0) {
error_reason = "unable to set syslog level";
goto parse_error;
}
}
snprintf(key_name, MAP_KEYNAME_MAXLEN, "%s.%s", path, "syslog_priority");
if (map_get_string(key_name, &value) == CS_OK) {
int syslog_priority;
syslog_priority = logsys_priority_id_get(value);
free(value);
if (syslog_priority < 0) {
error_reason = "unknown syslog priority specified";
goto parse_error;
}
if (logsys_config_syslog_priority_set(subsys,
syslog_priority) < 0) {
error_reason = "unable to set syslog priority";
goto parse_error;
}
}
else if(strcmp(key_name, "logging.syslog_priority") == 0){
if (logsys_config_syslog_priority_set(subsys,
logsys_priority_id_get("info")) < 0) {
error_reason = "unable to set syslog level";
goto parse_error;
}
}
#ifdef LOGCONFIG_USE_ICMAP
snprintf(key_name, MAP_KEYNAME_MAXLEN, "%s.%s", path, "logfile");
if (map_get_string(key_name, &value) == CS_OK) {
if (logsys_config_file_set (subsys, &error_reason, value) < 0) {
goto parse_error;
}
free(value);
}
#else
if (!subsys) {
if (logsys_config_file_set (subsys, &error_reason, main_logfile) < 0) {
goto parse_error;
}
}
#endif
if (corosync_main_config_log_destination_set (path, "to_file", subsys, &error_reason,
LOGSYS_MODE_OUTPUT_FILE, 1, 0, "to_logfile") != 0)
goto parse_error;
if (corosync_main_config_log_destination_set (path, "to_logfile", subsys, &error_reason,
LOGSYS_MODE_OUTPUT_FILE, 0, 0, NULL) != 0)
goto parse_error;
snprintf(key_name, MAP_KEYNAME_MAXLEN, "%s.%s", path, "logfile_priority");
if (map_get_string(key_name, &value) == CS_OK) {
int logfile_priority;
logfile_priority = logsys_priority_id_get(value);
free(value);
if (logfile_priority < 0) {
error_reason = "unknown logfile priority specified";
goto parse_error;
}
if (logsys_config_logfile_priority_set(subsys,
logfile_priority) < 0) {
error_reason = "unable to set logfile priority";
goto parse_error;
}
}
else if(strcmp(key_name,"logging.logfile_priority") == 0){
if (logsys_config_logfile_priority_set(subsys,
logsys_priority_id_get("info")) < 0) {
error_reason = "unable to set syslog level";
goto parse_error;
}
}
snprintf(key_name, MAP_KEYNAME_MAXLEN, "%s.%s", path, "debug");
if (map_get_string(key_name, &value) == CS_OK) {
if (strcmp (value, "trace") == 0) {
if (logsys_config_debug_set (subsys, LOGSYS_DEBUG_TRACE) < 0) {
error_reason = "unable to set debug trace";
free(value);
goto parse_error;
}
} else
if (strcmp (value, "on") == 0) {
if (logsys_config_debug_set (subsys, LOGSYS_DEBUG_ON) < 0) {
error_reason = "unable to set debug on";
free(value);
goto parse_error;
}
} else
if (strcmp (value, "off") == 0) {
if (logsys_config_debug_set (subsys, LOGSYS_DEBUG_OFF) < 0) {
error_reason = "unable to set debug off";
free(value);
goto parse_error;
}
} else {
error_reason = "unknown value for debug";
free(value);
goto parse_error;
}
free(value);
}
else {
if (logsys_config_debug_set (subsys, LOGSYS_DEBUG_OFF) < 0) {
error_reason = "unable to set debug off";
goto parse_error;
}
}
return (0);
parse_error:
*error_string = error_reason;
return (-1);
}
static int corosync_main_config_read_logging (
const char **error_string)
{
const char *error_reason;
#ifdef LOGCONFIG_USE_ICMAP
icmap_iter_t iter;
const char *key_name;
#else
cmap_iter_handle_t iter;
char key_name[CMAP_KEYNAME_MAXLEN];
#endif
char key_subsys[MAP_KEYNAME_MAXLEN];
char key_item[MAP_KEYNAME_MAXLEN];
int res;
/* format set is supported only for toplevel */
if (corosync_main_config_format_set(&error_reason) < 0) {
goto parse_error;
}
if (corosync_main_config_blackbox_set(&error_reason) < 0) {
goto parse_error;
}
if (corosync_main_config_set ("logging", NULL, &error_reason) < 0) {
goto parse_error;
}
/*
* we will need 2 of these to compensate for new logging
* config format
*/
#ifdef LOGCONFIG_USE_ICMAP
iter = icmap_iter_init("logging.logger_subsys.");
while ((key_name = icmap_iter_next(iter, NULL, NULL)) != NULL) {
#else
cmap_iter_init(cmap_handle, "logging.logger_subsys.", &iter);
while ((cmap_iter_next(cmap_handle, iter, key_name, NULL, NULL)) == CS_OK) {
#endif
res = sscanf(key_name, "logging.logger_subsys.%[^.].%s", key_subsys, key_item);
if (res != 2) {
continue ;
}
if (strcmp(key_item, "subsys") != 0) {
continue ;
}
if (snprintf(key_item, MAP_KEYNAME_MAXLEN, "logging.logger_subsys.%s",
key_subsys) >= MAP_KEYNAME_MAXLEN) {
/*
* This should never happen
*/
error_reason = "Can't snprintf logger_subsys key_item";
goto parse_error;
}
if (corosync_main_config_set(key_item, key_subsys, &error_reason) < 0) {
goto parse_error;
}
}
#ifdef LOGCONFIG_USE_ICMAP
icmap_iter_finalize(iter);
#else
cmap_iter_finalize(cmap_handle, iter);
#endif
logsys_config_apply();
/* Reconfigure knet logging */
totemknet_configure_log_level();
return 0;
parse_error:
*error_string = error_reason;
return (-1);
}
#ifdef LOGCONFIG_USE_ICMAP
static void main_logging_notify(
int32_t event,
const char *key_name,
struct icmap_notify_value new_val,
struct icmap_notify_value old_val,
void *user_data)
#else
static void main_logging_notify(
cmap_handle_t cmap_handle_unused,
cmap_handle_t cmap_track_handle_unused,
int32_t event,
const char *key_name,
struct cmap_notify_value new_val,
struct cmap_notify_value old_val,
void *user_data)
#endif
{
const char *error_string;
static int reload_in_progress = 0;
/* If a full reload happens then suspend updates for individual keys until
* it's all completed
*/
if (strcmp(key_name, "config.reload_in_progress") == 0) {
if (*(uint8_t *)new_val.data == 1) {
reload_in_progress = 1;
} else {
reload_in_progress = 0;
}
}
if (reload_in_progress) {
log_printf(LOGSYS_LEVEL_DEBUG, "Ignoring key change, reload in progress. %s\n", key_name);
return;
}
/*
* Reload the logsys configuration
*/
if (logsys_format_set(NULL) == -1) {
fprintf (stderr, "Unable to setup logging format.\n");
}
corosync_main_config_read_logging(&error_string);
}
#ifdef LOGCONFIG_USE_ICMAP
static void add_logsys_config_notification(void)
{
icmap_track_t icmap_track = NULL;
icmap_track_add("logging.",
ICMAP_TRACK_ADD | ICMAP_TRACK_DELETE | ICMAP_TRACK_MODIFY | ICMAP_TRACK_PREFIX,
main_logging_notify,
NULL,
&icmap_track);
icmap_track_add("config.reload_in_progress",
ICMAP_TRACK_ADD | ICMAP_TRACK_MODIFY,
main_logging_notify,
NULL,
&icmap_track);
}
#else
static void add_logsys_config_notification(void)
{
cmap_track_handle_t cmap_track;
cmap_track_add(cmap_handle, "logging.",
CMAP_TRACK_ADD | CMAP_TRACK_DELETE | CMAP_TRACK_MODIFY | CMAP_TRACK_PREFIX,
main_logging_notify,
NULL,
&cmap_track);
cmap_track_add(cmap_handle, "config.reload_in_progress",
CMAP_TRACK_ADD | CMAP_TRACK_MODIFY,
main_logging_notify,
NULL,
&cmap_track);
}
#endif
int corosync_log_config_read (
#ifndef LOGCONFIG_USE_ICMAP
cmap_handle_t cmap_h,
const char *default_logfile,
#endif
const char **error_string)
{
const char *error_reason = error_string_response;
#ifndef LOGCONFIG_USE_ICMAP
if (!cmap_h) {
error_reason = "No cmap handle";
return (-1);
}
if (!default_logfile) {
error_reason = "No default logfile";
return (-1);
}
cmap_handle = cmap_h;
main_logfile = default_logfile;
#endif
if (corosync_main_config_read_logging(error_string) < 0) {
error_reason = *error_string;
goto parse_error;
}
add_logsys_config_notification();
return 0;
parse_error:
snprintf (error_string_response, sizeof(error_string_response),
"parse error in config: %s.\n",
error_reason);
*error_string = error_string_response;
return (-1);
}
cmap.h
config.h
CS_OK
@ CS_OK
Definition corotypes.h:99
util.h
value
uint32_t value
Definition exec/votequorum.c:2
cmap_iter_handle_t
uint64_t cmap_iter_handle_t
Definition cmap.h:59
CMAP_KEYNAME_MAXLEN
#define CMAP_KEYNAME_MAXLEN
Definition cmap.h:69
cmap_iter_next
cs_error_t cmap_iter_next(cmap_handle_t handle, cmap_iter_handle_t iter_handle, char key_name[], size_t *value_len, cmap_value_types_t *type)
Return next item in iterator iter.
Definition lib/cmap.c:878
cmap_track_add
cs_error_t cmap_track_add(cmap_handle_t handle, const char *key_name, int32_t track_type, cmap_notify_fn_t notify_fn, void *user_data, cmap_track_handle_t *cmap_track_handle)
Add tracking function for given key_name.
Definition lib/cmap.c:977
cmap_handle_t
uint64_t cmap_handle_t
Definition cmap.h:54
cmap_track_handle_t
uint64_t cmap_track_handle_t
Definition cmap.h:64
CMAP_TRACK_DELETE
#define CMAP_TRACK_DELETE
Definition cmap.h:79
CMAP_TRACK_ADD
#define CMAP_TRACK_ADD
Definition cmap.h:78
cmap_iter_finalize
cs_error_t cmap_iter_finalize(cmap_handle_t handle, cmap_iter_handle_t iter_handle)
Finalize iterator.
Definition lib/cmap.c:938
cmap_iter_init
cs_error_t cmap_iter_init(cmap_handle_t handle, const char *prefix, cmap_iter_handle_t *cmap_iter_handle)
Initialize iterator with given prefix.
Definition lib/cmap.c:823
CMAP_TRACK_PREFIX
#define CMAP_TRACK_PREFIX
Whole prefix is tracked, instead of key only (so "totem." tracking means that "totem....
Definition cmap.h:87
CMAP_TRACK_MODIFY
#define CMAP_TRACK_MODIFY
Definition cmap.h:80
icmap.h
ICMAP_TRACK_MODIFY
#define ICMAP_TRACK_MODIFY
Definition icmap.h:78
ICMAP_TRACK_DELETE
#define ICMAP_TRACK_DELETE
Definition icmap.h:77
icmap_track_add
cs_error_t icmap_track_add(const char *key_name, int32_t track_type, icmap_notify_fn_t notify_fn, void *user_data, icmap_track_t *icmap_track)
Add tracking function for given key_name.
Definition icmap.c:1163
ICMAP_TRACK_PREFIX
#define ICMAP_TRACK_PREFIX
Whole prefix is tracked, instead of key only (so "totem." tracking means that "totem....
Definition icmap.h:85
icmap_iter_init
icmap_iter_t icmap_iter_init(const char *prefix)
Initialize iterator with given prefix.
Definition icmap.c:1093
icmap_iter_next
const char * icmap_iter_next(icmap_iter_t iter, size_t *value_len, icmap_value_types_t *type)
Return next item in iterator iter.
Definition icmap.c:1099
icmap_iter_t
qb_map_iter_t * icmap_iter_t
Itterator type.
Definition icmap.h:123
icmap_iter_finalize
void icmap_iter_finalize(icmap_iter_t iter)
Finalize iterator.
Definition icmap.c:1120
icmap_track_t
struct icmap_track * icmap_track_t
Track type.
Definition icmap.h:128
ICMAP_TRACK_ADD
#define ICMAP_TRACK_ADD
Definition icmap.h:76
MAP_KEYNAME_MAXLEN
#define MAP_KEYNAME_MAXLEN
Definition logconfig.c:49
map_get_string
#define map_get_string(key_name, value)
Definition logconfig.c:50
corosync_log_config_read
int corosync_log_config_read(cmap_handle_t cmap_h, const char *default_logfile, const char **error_string)
Definition logconfig.c:719
logconfig.h
logsys.h
logsys_config_mode_get
unsigned int logsys_config_mode_get(const char *subsys)
logsys_config_mode_get
Definition logsys.c:527
log_printf
#define log_printf(level, format, args...)
Definition logsys.h:332
logsys_config_mode_set
int logsys_config_mode_set(const char *subsys, unsigned int mode)
logsys_config_mode_set
Definition logsys.c:505
logsys_blackbox_set
void logsys_blackbox_set(int enable)
Definition logsys.c:883
logsys_format_get
char * logsys_format_get(void)
logsys_format_get
Definition logsys.c:652
LOGSYS_DEBUG_OFF
#define LOGSYS_DEBUG_OFF
Definition logsys.h:92
logsys_config_file_set
int logsys_config_file_set(const char *subsys, const char **error_string, const char *file)
to close a logfile, just invoke this function with a NULL file or if you want to change logfile,...
Definition logsys.c:539
LOGSYS_MODE_OUTPUT_STDERR
#define LOGSYS_MODE_OUTPUT_STDERR
Definition logsys.h:61
logsys_config_syslog_priority_set
int logsys_config_syslog_priority_set(const char *subsys, unsigned int priority)
logsys_config_syslog_priority_set
Definition logsys.c:664
LOGSYS_DEBUG_TRACE
#define LOGSYS_DEBUG_TRACE
Definition logsys.h:94
logsys_config_apply
void logsys_config_apply(void)
logsys_config_apply
Definition logsys.c:792
logsys_priority_id_get
int logsys_priority_id_get(const char *name)
logsys_priority_id_get
Definition logsys.c:849
logsys_config_logfile_priority_set
int logsys_config_logfile_priority_set(const char *subsys, unsigned int priority)
logsys_config_logfile_priority_set
Definition logsys.c:691
LOGSYS_DEBUG_ON
#define LOGSYS_DEBUG_ON
Definition logsys.h:93
logsys_config_debug_set
int logsys_config_debug_set(const char *subsys, unsigned int value)
enabling debug, disable message priority filtering.
Definition logsys.c:823
LOGSYS_LEVEL_WARNING
#define LOGSYS_LEVEL_WARNING
Definition logsys.h:73
_logsys_subsys_create
int _logsys_subsys_create(const char *subsys, const char *filename)
_logsys_subsys_create
Definition logsys.c:435
logsys_config_syslog_facility_set
int logsys_config_syslog_facility_set(const char *subsys, unsigned int facility)
per system/subsystem settings.
Definition logsys.c:657
LOGSYS_LEVEL_DEBUG
#define LOGSYS_LEVEL_DEBUG
Definition logsys.h:76
LOGSYS_MODE_OUTPUT_FILE
#define LOGSYS_MODE_OUTPUT_FILE
Definition logsys.h:60
LOGSYS_MODE_OUTPUT_SYSLOG
#define LOGSYS_MODE_OUTPUT_SYSLOG
Definition logsys.h:62
logsys_format_set
int logsys_format_set(const char *format)
configuration bits that can only be done for the whole system
Definition logsys.c:593
user_data
void * user_data
Definition sam.c:127
cmap_handle
cmap_handle_t cmap_handle
Definition sam.c:137
cmap_notify_value
Structure passed as new_value and old_value in change callback.
Definition cmap.h:117
cmap_notify_value::data
const void * data
Definition cmap.h:120
icmap_notify_value
Structure passed as new_value and old_value in change callback.
Definition icmap.h:91
icmap_track
Definition icmap.c:61
totem.h
totemknet_configure_log_level
void totemknet_configure_log_level()
Definition totemknet.c:903
totemknet.h