mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-26 15:35:55 +00:00
31 lines
692 B
Go
31 lines
692 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("NTSN")
|
|
spawn = panics.GoroutineWrapperFunc(log)
|
|
)
|
|
|
|
func initLog(logFile, errLogFile string) {
|
|
level := logger.LevelInfo
|
|
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)
|
|
}
|