diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-02-07 13:47:26 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-09-29 12:15:40 +0200 |
commit | 666f12e0c19a19f4431e05f6e5b37e657a62038f (patch) | |
tree | ba5a20de0da52c1651184e080440462f97c8305a /include/printk.h | |
parent | 61694c93cd9e47e2ea72d9095817040a4c0c2cee (diff) | |
download | barebox-666f12e0c19a19f4431e05f6e5b37e657a62038f.tar.gz barebox-666f12e0c19a19f4431e05f6e5b37e657a62038f.tar.xz |
introduce runtime loglevel
With this the verbosity of barebox can be controlled during runtime
using the 'loglevel' globalvar.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/printk.h')
-rw-r--r-- | include/printk.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/printk.h b/include/printk.h index 86bf208425..f550f07bb8 100644 --- a/include/printk.h +++ b/include/printk.h @@ -18,12 +18,15 @@ /* debugging and troubleshooting/diagnostic helpers. */ -int dev_printf(const struct device_d *dev, const char *format, ...) +int pr_print(int level, const char *format, ...) __attribute__ ((format(__printf__, 2, 3))); +int dev_printf(int level, const struct device_d *dev, const char *format, ...) + __attribute__ ((format(__printf__, 3, 4))); + #define __dev_printf(level, dev, format, args...) \ ({ \ - (level) <= LOGLEVEL ? dev_printf((dev), (format), ##args) : 0; \ + (level) <= LOGLEVEL ? dev_printf((level), (dev), (format), ##args) : 0; \ }) @@ -46,7 +49,7 @@ int dev_printf(const struct device_d *dev, const char *format, ...) #define __pr_printk(level, format, args...) \ ({ \ - (level) <= LOGLEVEL ? printk((format), ##args) : 0; \ + (level) <= LOGLEVEL ? pr_print((level), (format), ##args) : 0; \ }) #ifndef pr_fmt |