- 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
20 lines
375 B
V
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
|
|
}
|
|
}
|