aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2014-07-31 14:29:47 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-08-08 16:07:26 +1000
commit6a54d6dad7320e348a23b2e5df29b407810e105f (patch)
treed9232d81d79ff59978abe8d92fefe86273ee45ed /include
parent89a9ca379f2bcf618ae8796dfdd277424249da32 (diff)
downloadskiboot-6a54d6dad7320e348a23b2e5df29b407810e105f.zip
skiboot-6a54d6dad7320e348a23b2e5df29b407810e105f.tar.gz
skiboot-6a54d6dad7320e348a23b2e5df29b407810e105f.tar.bz2
add full suite of log priorities: EMERG through DEBUG
The idea is to use prlog(PR_EMERG|PR_ALERT|...|PR_WARNING|..|PR_TRACE) instead of random printf() calls, so that they can be properly filtered for different console implementations (may only want trace level calls in memory console rather than over serial port). We remap PR_PRINTF to PR_NOTICE (5) rather than the absolute value 5. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'include')
-rw-r--r--include/skiboot.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/skiboot.h b/include/skiboot.h
index 22777b3..79f85ce 100644
--- a/include/skiboot.h
+++ b/include/skiboot.h
@@ -76,10 +76,20 @@ struct debug_descriptor {
};
extern struct debug_descriptor debug_descriptor;
-/* General utilities */
+/* Console logging */
+#define PR_EMERG 0
+#define PR_ALERT 1
+#define PR_CRIT 2
+#define PR_ERR 3
+#define PR_WARNING 4
+#define PR_NOTICE 5
+#define PR_PRINTF PR_NOTICE
+#define PR_INFO 6
+#define PR_DEBUG 7
+#define PR_TRACE 8
+#define PR_INSANE 9
void prlog(int log_level, const char* fmt, ...) __attribute__((format (printf, 2, 3)));
-#define prerror(fmt...) do { prlog(0, fmt); } while(0)
-#define PR_PRINTF 5
+#define prerror(fmt...) do { prlog(PR_ERR, fmt); } while(0)
/* Location codes -- at most 80 chars with null termination */
#define LOC_CODE_SIZE 80