Files
herolib/lib/core/logger/factory.v
Mahmoud-Emad f54c57847a feat: Enhance logging and CORS handling
- Add console output option to logger
- Implement ISO time conversion for calendar events
- Add OPTIONS method for API and root handlers
- Introduce health check endpoint with uptime and server info
- Implement manual CORS handling in `before_request`
- Add `start_time` to HeroServer for uptime tracking
- Add `ServerLogParams` and `log` method for server logging
2025-09-18 17:29:11 +03:00

20 lines
375 B
V

module logger
import freeflowuniverse.herolib.core.pathlib
// Logger Factory
pub struct LoggerFactoryArgs {
pub mut:
path string
console_output bool = true
}
pub fn new(args LoggerFactoryArgs) !Logger {
mut p := pathlib.get_dir(path: args.path, create: true)!
return Logger{
path: p
lastlog_time: 0
console_output: args.console_output
}
}