summaryrefslogtreecommitdiff
path: root/logger/priority.go
diff options
context:
space:
mode:
authorDavid Fisher <ddf1991@gmail.com>2013-09-24 13:41:27 -0700
committerDavid Fisher <ddf1991@gmail.com>2013-09-24 13:45:20 -0700
commit192de075a64a9f33d80f9d3969bf069e77f1a255 (patch)
tree25b4dad914771b3756d4860b8895dce0942cc142 /logger/priority.go
parent4d19cb1636614de01cffc64599f034092e1ba9f1 (diff)
First version/rewrite
Diffstat (limited to 'logger/priority.go')
-rw-r--r--logger/priority.go38
1 files changed, 38 insertions, 0 deletions
diff --git a/logger/priority.go b/logger/priority.go
new file mode 100644
index 0000000..429041b
--- /dev/null
+++ b/logger/priority.go
@@ -0,0 +1,38 @@
+package logger
+
+type Priority int
+
+const (
+ PriEmerg Priority = iota
+ PriAlert
+ PriCrit
+ PriErr
+ PriWarning
+ PriNotice
+ PriInfo
+ PriDebug
+)
+
+func (priority Priority) String() string {
+ switch priority {
+ case PriEmerg:
+ return "EMERGENCY"
+ case PriAlert:
+ return "ALERT"
+ case PriCrit:
+ return "CRITICAL"
+ case PriErr:
+ return "ERROR"
+ case PriWarning:
+ return "WARNING"
+ case PriNotice:
+ return "NOTICE"
+ case PriInfo:
+ return "INFO"
+ case PriDebug:
+ return "DEBUG"
+
+ default:
+ return "UNKNOWN"
+ }
+}