I tried to reconstruct libcgroup logging. Currently we log to stdout and only
if --enable-debug is specifed on configure command line.

With this patchset, libcgroup ends up with:
 - multiple log levels of messages.
 - logging to stdout by default (!), but only errors and warnings go there.
   -> our tools (cgcreate, cgconfigparser, ...) log errors/warnings to stdout
      by default.
   -> the log level can be easily controller by CGROUP_LOGLEVEL environment
      variable (e.g. to print debug messages during development or to create
      proper error report). I might eventually add -v and -q options for more
      vebose/quiet tools.
 - applications can set their own callback to put log messages to syslog, log
   file, gui window or just where they want and they can specify level of
   messages they want to receive.
 - all is documented, both for application developers in doxygen and for users
   in man pages.

The benefit of this patchset is that the user not only gets error code, which
translated by cgroup_strerror() tells something that 'Cgroup mounting failed',
but also gets more detailed message what exactly went wrong, like
'Error mounting cpuacct to /cgroup/cpu: Operation not permitted'.

I also added one simple test + fixed test with named-hierarchies (this not not
related to this patchset, I just needed to 'make check' pass).

Jan


------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to