summaryrefslogtreecommitdiff
path: root/logger/priority.go
diff options
context:
space:
mode:
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"
+ }
+}