Commit Graph

11 Commits

Author SHA1 Message Date
Angus Salkeld
42d20b5090 Get coverity to ignore this warning.
"Using uninitialized element of array"

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-03 14:42:25 +11:00
Angus Salkeld
36e77bb99d LOG: only bump messages that need it (>info)
else all the messages get their priorities distorted

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-23 16:47:30 +11:00
Angus Salkeld
ab3dc60f7f Merge some portability changes from the mingw branch
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-21 14:23:43 +11:00
Angus Salkeld
c41113aaec LOG: move priority check up to prevent unnecessary format.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-07-14 12:38:02 +10:00
Angus Salkeld
98493d9ae8 Change Lindent options to break the procedure type.
so change:
int foo(void)

to

int
foo(void)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-06-22 14:19:14 +10:00
Angus Salkeld
048edde19c LOG: add custom targets
This is partly to make the tests more robusts and
to add some more flexibility to the logging.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-23 20:28:18 +10:00
Angus Salkeld
78541f5198 LOG: add the ability to adjust the priority sent to syslog()
If you have:
qb_log_filter_ctl(QB_LOG_SYSLOG, QB_LOG_FILTER_ADD,
		  QB_LOG_FILTER_FILE, "hack.c", LOG_DEBUG);
these logs will not make there way to /var/log/messags
without reconfiguring syslog.

So to help on the fly debugging do the following:
qb_log_ctl(QB_LOG_SYSLOG, QB_LOG_CONF_PRIORITY_BUMP,
	   LOG_INFO - LOG_DEBUG);

Now all messages that have the QB_LOG_SYSLOG target set
will have their priority bumped before going to syslog().

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-12 22:20:50 +10:00
Angus Salkeld
c97d98f7f7 LOG: general cleanup (indentation, NULL checks, etc...) 2011-04-01 15:32:44 +11:00
Angus Salkeld
34c96d57e5 LOG: deal better with timestamps
1) use gettimeofday() - suprisingly faster than clock_gettime(MONOTONIC)
2) don't format the time until it is needed
3) insert time_t into the blackbox (not a formatted string)

This improves performance and tidies the code up.
It also requires less space in the blackbox.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-31 21:30:12 +11:00
Angus Salkeld
34ee74db55 LOG: add a format option to each target.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-30 23:06:41 +11:00
Angus Salkeld
32817adb15 LOG: re-work the API to be easier to use.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-30 11:46:36 +11:00