Skip to content

Commit

Permalink
Merge branch 'feature/cli_log' into 'develop'
Browse files Browse the repository at this point in the history
reset transport for cli log

See merge request goku/apinto!63
  • Loading branch information
chen2eric committed Jun 30, 2022
2 parents ca0045b + 490b990 commit 6b73017
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/apinto/log.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package main

import (
"github.com/eolinker/eosc/log"
"os"
)

func InitCLILog() {
formatter := &log.LineFormatter{
TimestampFormat: "2006-01-02 15:04:05",
CallerPrettyfier: nil,
}
transport := log.NewTransport(os.Stdout, log.ErrorLevel)
transport.SetFormatter(formatter)
log.Reset(transport)
}
2 changes: 2 additions & 0 deletions app/apinto/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ func init() {
process.Register(eosc.ProcessMaster, ProcessMaster)
process.Register(eosc.ProcessHelper, ProcessHelper)
process.Register(eosc.ProcessAdmin, ProcessAdmin)

InitCLILog()
}

func main() {
Expand Down

0 comments on commit 6b73017

Please sign in to comment.