summaryrefslogtreecommitdiffstats
path: root/modules/log/level.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/log/level.go')
-rw-r--r--modules/log/level.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/log/level.go b/modules/log/level.go
index 4b89385fe2..ab231bd1bd 100644
--- a/modules/log/level.go
+++ b/modules/log/level.go
@@ -73,6 +73,16 @@ func (l Level) String() string {
return "info"
}
+// Color returns the color string for this Level
+func (l Level) Color() *[]byte {
+ color, ok := levelToColor[l]
+ if ok {
+ return &(color)
+ }
+ none := levelToColor[NONE]
+ return &none
+}
+
// MarshalJSON takes a Level and turns it into text
func (l Level) MarshalJSON() ([]byte, error) {
buffer := bytes.NewBufferString(`"`)