mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-27 07:48:44 +00:00
31 lines
693 B
Go
31 lines
693 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/c4ei/yunseokyeol/infrastructure/logger"
|
|
"github.com/c4ei/yunseokyeol/stability-tests/common"
|
|
"github.com/c4ei/yunseokyeol/util/panics"
|
|
)
|
|
|
|
var (
|
|
backendLog = logger.NewBackend()
|
|
log = backendLog.Logger("MATS")
|
|
spawn = panics.GoroutineWrapperFunc(log)
|
|
)
|
|
|
|
func initLog(logFile, errLogFile string) {
|
|
level := logger.LevelDebug
|
|
if activeConfig().LogLevel != "" {
|
|
var ok bool
|
|
level, ok = logger.LevelFromString(activeConfig().LogLevel)
|
|
if !ok {
|
|
fmt.Fprintf(os.Stderr, "Log level %s doesn't exists", activeConfig().LogLevel)
|
|
os.Exit(1)
|
|
}
|
|
}
|
|
log.SetLevel(level)
|
|
common.InitBackend(backendLog, logFile, errLogFile)
|
|
}
|