mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00

* Unfinished code. * Update the testnet version to testnet-5. (#1683) * Generalize stability-tests/docker/Dockerfile. (#1685) * Committed for rebasing. * Adds stability-test many-tips, which tests kaspad handling with many tips in the DAG. * Delete manytips_test.go. * Add timeout to the test and create only one RPC client. * Place the spawn before the for loop and remove a redundant condition. Co-authored-by: tal <tal@daglabs.com> Co-authored-by: stasatdaglabs <39559713+stasatdaglabs@users.noreply.github.com>
30 lines
689 B
Go
30 lines
689 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/kaspanet/kaspad/infrastructure/logger"
|
|
"github.com/kaspanet/kaspad/stability-tests/common"
|
|
"github.com/kaspanet/kaspad/util/panics"
|
|
"os"
|
|
)
|
|
|
|
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)
|
|
}
|