improving logger to write to a file

This commit is contained in:
2024-12-14 14:04:33 +09:00
parent 3299ca0fb2
commit bc9a40106c
4 changed files with 104 additions and 37 deletions

View File

@ -34,6 +34,7 @@ type Service interface {
RunTask(wg *sync.WaitGroup) // blocking. run the actual task loop. it must call wg.Done() upon exit from itself.
StartService(data interface{}) // non-blocking. spin up a service. it may be invokded multiple times for multiple instances
StopServices() // non-blocking. send stop request to all services spun up
FixServices() // do some fixup as needed
WaitForTermination() // blocking. must wait until all services are stopped
WriteLog(id string, level LogLevel, fmtstr string, args ...interface{})
}