// Copyright 2014 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package log import ( "encoding/json" "log" "os" "runtime" ) type Brush func(string) string func NewBrush(color string) Brush { pre := "\033[" reset := "\033[0m" return func(text string) string { return pre + color + "m" + text + reset } } var colors = []Brush{ NewBrush("1;36"), // Trace cyan NewBrush("1;34"), // Debug blue NewBrush("1;32"), // Info green NewBrush("1;33"), // Warn yellow NewBrush("1;31"), // Error red NewBrush("1;35"), // Critical purple NewBrush("1;31"), // Fatal red } // ConsoleWriter implements LoggerInterface and writes messages to terminal. type ConsoleWriter struct { lg *log.Logger Level int `json:"level"` } // create ConsoleWriter returning as LoggerInterface. func NewConsole() LoggerInterface { return &ConsoleWriter{ lg: log.New(os.Stdout, "", log.Ldate|log.Ltime), Level: TRACE, } } func (cw *ConsoleWriter) Init(config string) error { return json.Unmarshal([]byte(config), cw) } func (cw *ConsoleWriter) WriteMsg(msg string, skip, level int) error { if cw.Level > level { return nil } if runtime.GOOS == "windows" { cw.lg.Println(msg) } else { cw.lg.Println(colors[level](msg)) } return nil } func (_ *ConsoleWriter) Flush() { } func (_ *ConsoleWriter) Destroy() { } func init() { Register("console", NewConsole) } PANIC: session(release): write data/sessions/d/b/db4449d9808cd793: no space left on device

PANIC

session(release): write data/sessions/d/b/db4449d9808cd793: no space left on device
github.com/go-macaron/session@v0.0.0-20190805070824-1a3cdc6f5659/session.go:199 (0x8b2934)
gopkg.in/macaron.v1@v1.3.9/context.go:79 (0x83d0a0)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/context.go:112 (0x84fdb5)
gopkg.in/macaron.v1@v1.3.9/recovery.go:161 (0x84fda8)
gopkg.in/macaron.v1@v1.3.9/logger.go:40 (0x840c73)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/router.go:187 (0x850fc6)
gopkg.in/macaron.v1@v1.3.9/router.go:303 (0x8493e5)
gopkg.in/macaron.v1@v1.3.9/macaron.go:220 (0x841fca)
net/http/server.go:2836 (0x7a79b2)
net/http/server.go:1924 (0x7a341b)
runtime/asm_amd64.s:1373 (0x46f9f0)