summaryrefslogtreecommitdiffstats
path: root/lib/log/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/log/log.c')
-rw-r--r--lib/log/log.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/log/log.c b/lib/log/log.c
index adb2078..0b145e0 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -34,6 +34,15 @@ void pb_log(const char *fmt, ...)
va_end(ap);
}
+void _pb_log_fn(const char *func, const char *fmt, ...)
+{
+ va_list ap;
+ pb_log("%s: ", func);
+ va_start(ap, fmt);
+ __log(fmt, ap);
+ va_end(ap);
+}
+
void pb_debug(const char *fmt, ...)
{
va_list ap;
@@ -44,6 +53,28 @@ void pb_debug(const char *fmt, ...)
va_end(ap);
}
+void _pb_debug_fn(const char *func, const char *fmt, ...)
+{
+ va_list ap;
+ if (!debug)
+ return;
+ pb_log("%s: ", func);
+ va_start(ap, fmt);
+ __log(fmt, ap);
+ va_end(ap);
+}
+
+void _pb_debug_fl(const char *func, int line, const char *fmt, ...)
+{
+ va_list ap;
+ if (!debug)
+ return;
+ pb_log("%s:%d: ", func, line);
+ va_start(ap, fmt);
+ __log(fmt, ap);
+ va_end(ap);
+}
+
void __pb_log_init(FILE *fp, bool _debug)
{
if (logf)
OpenPOWER on IntegriCloud