summaryrefslogtreecommitdiffstats
path: root/src/openlmi.h
diff options
context:
space:
mode:
authorRadek Novacek <rnovacek@redhat.com>2013-09-12 16:02:28 +0200
committerRadek Novacek <rnovacek@redhat.com>2013-09-19 09:19:35 +0200
commitba68ac8759f664b9079ca9d5b6772285f6433be6 (patch)
tree61bd6fd11741abeccdb84687d4822ea0e1cb982c /src/openlmi.h
parent0f356df6cc42573ed7bf91ffb4ba8da4f516f5b4 (diff)
downloadopenlmi-providers-ba68ac8759f664b9079ca9d5b6772285f6433be6.tar.gz
openlmi-providers-ba68ac8759f664b9079ca9d5b6772285f6433be6.tar.xz
openlmi-providers-ba68ac8759f664b9079ca9d5b6772285f6433be6.zip
Improve logging in C providers
Use CMLogMessage instead of CMTraceMessage for each message with level > ERROR. The logging level is now read from the config file. The Stderr option for logging to stderr in now also honored.
Diffstat (limited to 'src/openlmi.h')
-rw-r--r--src/openlmi.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/openlmi.h b/src/openlmi.h
index 93778ce..7d64bd1 100644
--- a/src/openlmi.h
+++ b/src/openlmi.h
@@ -22,6 +22,7 @@
#define OPENLMI_H
#include <cmpidt.h>
+#include <stdbool.h>
typedef struct {
const char *group;
@@ -78,11 +79,26 @@ void lmi_init(const char *provider, const CMPIBroker *cb,
char *lmi_read_config(const char *group, const char *key);
/**
+ * Reads a boolean value out of configuration files or default configuration
+ * options.
+ *
+ * Values "1", "yes", "true", and "on" are converted to TRUE, others to FALSE
+ *
+ * @param group Configration group
+ * @param key Configration key
+ * @return Boolean value of the key, false if the key is not in the
+ * configuration files neither in default options.
+ */
+bool lmi_read_config_boolean(const char *group, const char *key);
+
+/**
* To use standard CIMOM logging facility, broker must be assigned. Without
* calling this function, logging will go to stderr.
*
- * \p log_id Identification of log messages
- * \p cb CMPIBroker
+ * @deprecated Use lmi_init instead
+ *
+ * @param log_id Identification of log messages
+ * @param cb CMPIBroker
*/
void lmi_init_logging(const char *log_id, const CMPIBroker *cb);
@@ -96,6 +112,9 @@ int lmi_log_level(void);
/**
* Set logging level
*
+ * @note This method shouldn't be used directly, user setting
+ * from the configuration file should be honored
+ *
* @param level new logging level
*/
void lmi_set_log_level(int level);