summaryrefslogtreecommitdiffstats
path: root/lib/log/log.c
Commit message (Collapse)AuthorAgeFilesLines
* log: Allow runtime selection of 'debug' log levelJeremy Kerr2014-04-071-0/+5
| | | | | | | | | | | | | | | | | Currently, we need to compile with -DDEBUG to implement debug-level logging in the UIs and discover server. Since we may not be able to easily replace a system's petitboot binaries, this change introduces a -v|--verbose option to the discver server and ncurses UI, which enables debug at runtime. We also move some of the udev debug code out of an #ifdef DEBUG block. Since petitboot is generally started on boot, we also add a little infrastructure to pass -v to petitboot on certain system contitions: either petitboot.debug on the kernel command line, or a petitboot,debug? NVRAM property containing the value 'true'. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/log: Always flush after writing logsJeremy Kerr2013-11-011-2/+1
| | | | | | | | We're currently seeing empty log files from the discover server. Rather than only flishing if the server was compiled with debugging enabled, always perform the fflush. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/log: Cleanup log APIJeremy Kerr2013-09-191-16/+32
| | | | | | | | | | Rather than exposing log internals (through always_flush and set_stream), do all logging init through pb_log_init(). If pb_log_init() hasn't been called, pb_log will drop messages. Also, add a pb_debug() function, specifically for debugging information. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Log to stderr, allow --log=-Geoff Levand2012-03-261-3/+3
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Get log streamGeoff Levand2009-03-301-0/+5
| | | | | | | | | Add a new convenience routine pb_log_get_stream() that returns the current PB_log stream. Used to setup the ps3-utils library to log to the pb_log. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Flush log stream on writeGeoff Levand2009-02-011-0/+10
| | | | | | | | | Flush the pb_log stream when the stream is changed, and add an option to flush the pb_log stream on every write. Useful while debugging. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Move log to libraryGeoff Levand2009-02-011-0/+23
Move the log routines to the petitboot library. The log routines are generic enough to be used for both server and client. Does not change the log source. jk: move to lib/log/ instead of lib/ Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud