Implements full markdown editor application with: Backend (Go): - Cobra CLI with --data-dir, --port, --host flags - REST API for CRUD operations on markdown files - File storage on disk with flat structure - Logrus logging for all operations - Static asset serving for frontend - Comprehensive tests for CRUD and static assets Frontend (React + TypeScript + Tailwind): - Markdown editor with live GFM preview - File management UI (list, create, open, save, delete) - Theme system (Dark, Light, System) with persistence - Responsive design (320px to 1920px) - Component tests for core functionality Integration: - Full CRUD workflow from frontend to backend - Static asset serving verified - All tests passing (backend: 2/2, frontend: 6/6) Files added: - Backend: API handler, logger, server, tests - Frontend: Components, tests, config files - Build artifacts: compiled backend binary and frontend dist - Documentation: README and implementation summary
18 lines
260 B
Go
18 lines
260 B
Go
package logger
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func NewLogger() *logrus.Logger {
|
|
log := logrus.New()
|
|
log.SetOutput(os.Stdout)
|
|
log.SetFormatter(&logrus.TextFormatter{
|
|
FullTimestamp: true,
|
|
})
|
|
log.SetLevel(logrus.InfoLevel)
|
|
return log
|
|
}
|