Files
agent-evals/internal/logger/logger.go
Evan Reichard 482d8a448a Initial commit: WYSIWYG Markdown Editor - Go backend + React/TypeScript frontend with Tailwind CSS
Backend:
- Cobra CLI with --data-dir, --port, --host flags
- Gin HTTP server with REST API for markdown CRUD operations
- File storage on disk (.md files only)
- Comprehensive logrus logging
- Backend tests with CRUD round-trip verification

Frontend:
- React 18 + TypeScript + Tailwind CSS
- Markdown editor with live GFM preview (react-markdown + remark-gfm)
- File management UI (list, create, open, save, delete)
- Theme switcher with Dark/Light/System modes
- Responsive design
- Frontend tests with vitest

Testing:
- All backend tests pass (go test ./...)
- All frontend tests pass (npm test)
2026-02-05 15:44:06 -05:00

32 lines
485 B
Go

package logger
import (
"github.com/sirupsen/logrus"
"os"
)
var (
log *logrus.Logger
)
func init() {
log = logrus.New()
log.SetLevel(logrus.InfoLevel)
log.SetFormatter(&logrus.JSONFormatter{})
// Output to stderr by default
log.SetOutput(os.Stderr)
}
func GetLogger() *logrus.Logger {
return log
}
func SetLevel(level string) {
lvl, err := logrus.ParseLevel(level)
if err != nil {
log.Warnf("Invalid log level %s, using INFO", level)
return
}
log.SetLevel(lvl)
}