Default target of log messages is stdout and ERRORs are sent there by
default.
This is quite a change from the behavior of previous versions - no logging
was sent anywhere unless --enable-debug was specified at ./configure time.
Signed-off-by: Peter Schiffer <pschiffe@redhat.com>
Acked-by: Ivana Hutarova Varekova <varekova@redhat.com>
/**
* Initialize libcgroup. Information about mounted hierarchies are examined
* and cached internally (just what's mounted where, not the groups themselves).
+ *
+ * If the cgroup logging was not set using cgroup_set_logger() or
+ * cgroup_set_default_logger() before calling cgroup_init(), the default logger
+ * is automatically set, logging CGROUP_LOG_ERROR messages.
*/
int cgroup_init(void);
* @par
* The logging callback can be set at any time, but setting the callback before
* any other libcgroup function (including cgroup_init()) is highly recommended.
+ * If no logger is set before cgroup_init() is called, default logger is
+ * automatically set, logging CGROUP_LOG_ERROR messages to stdout.
*
* @par Setting log level
* Some of the functions below set the log level as integer.
char mntent_buffer[4 * FILENAME_MAX];
char *strtok_buffer = NULL;
+ cgroup_set_default_logger(-1);
+
pthread_rwlock_wrlock(&cg_mount_table_lock);
/* free global variables filled by previous cgroup_init() */