Refactor: Rename NanoKVM to BatchuKVM and update server URL

This commit is contained in:
2025-12-09 20:35:38 +09:00
commit 8cf674c9e5
396 changed files with 54380 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
package logger
import (
"bytes"
"fmt"
"path/filepath"
"github.com/sirupsen/logrus"
)
type formatter struct{}
func (f *formatter) Format(entry *logrus.Entry) ([]byte, error) {
var (
text string
buffer *bytes.Buffer
)
if entry.Buffer != nil {
buffer = entry.Buffer
} else {
buffer = &bytes.Buffer{}
}
now := entry.Time.Format("2006-01-02 15:04:05.000")
if entry.HasCaller() {
fileName := filepath.Base(entry.Caller.File)
text = fmt.Sprintf(
"[%s] [%s] [%s:%d] %s\n",
now, entry.Level, fileName, entry.Caller.Line, entry.Message,
)
} else {
text = fmt.Sprintf(
"[%s] [%s] %s \n",
now, entry.Level, entry.Message,
)
}
buffer.WriteString(text)
return buffer.Bytes(), nil
}