This commit is contained in:
Suyono 2023-09-05 14:22:36 +10:00
parent a5a019b28b
commit 1f25e5249c
3 changed files with 12 additions and 5 deletions

View File

@ -2,19 +2,24 @@ package daemon
import (
"fmt"
"io"
"gitea.suyono.dev/suyono/wingmate/config"
"github.com/spf13/viper"
)
type service struct {
name string
logChannel chan<- any
errChannel chan<- error
name string
stdoutLogWriter io.WriteCloser
stderrLogWriter io.WriteCloser
logChannel chan<- any
errChannel chan<- error
}
func newService(name string, error chan<- error, logging chan<- any) *service {
return &service{
name: name,
name: name,
// stdoutLogWriter: log.NewLogFile(fmt.Sprintf("%s.%s.%s", Service.String(), name, config.CommandKey)),
logChannel: logging,
errChannel: error,
}

View File

@ -22,6 +22,8 @@ const (
Error Level = Level(zerolog.ErrorLevel)
Fatal Level = Level(zerolog.FatalLevel)
Panic Level = Level(zerolog.PanicLevel)
LogKey = "log"
)
var (

View File

@ -46,6 +46,6 @@ func (f *File) Close() error {
}
func (f *File) Rotate() error {
//TODO: implement log rotation
return nil
}