本文整理匯總了Golang中github.com/eris-ltd/eris-cli/Godeps/_workspace/src/github.com/eris-ltd/common/go/log.SetLoggers函數的典型用法代碼示例。如果您正苦於以下問題:Golang SetLoggers函數的具體用法?Golang SetLoggers怎麽用?Golang SetLoggers使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了SetLoggers函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: TestMain
func TestMain(m *testing.M) {
var logLevel log.LogLevel
logLevel = 0
// logLevel = 1
// logLevel = 3
log.SetLoggers(logLevel, os.Stdout, os.Stderr)
if err := testsInit(); err != nil {
logger.Errorln(err)
os.Exit(1)
}
exitCode := m.Run()
if os.Getenv("TEST_IN_CIRCLE") != "true" {
if err := testsTearDown(); err != nil {
logger.Errorln(err)
log.Flush()
os.Exit(1)
}
}
os.Exit(exitCode)
}
示例2: TestMain
func TestMain(m *testing.M) {
var logLevel log.LogLevel
logLevel = 0
// logLevel = 1
// logLevel = 3
log.SetLoggers(logLevel, os.Stdout, os.Stderr)
if os.Getenv("TEST_IN_CIRCLE") == "true" {
erisDir = os.Getenv("HOME")
}
file = path.Join(erisDir, "temp")
tests.IfExit(testsInit())
exitCode := m.Run()
if os.Getenv("TEST_IN_CIRCLE") != "true" {
testKillIPFS(nil)
tests.IfExit(tests.TestsTearDown())
}
os.Exit(exitCode)
}
示例3: TestMain
func TestMain(m *testing.M) {
var logLevel log.LogLevel
var err error
logLevel = 0
// logLevel = 1
// logLevel = 2
log.SetLoggers(logLevel, os.Stdout, os.Stderr)
testsInit()
logger.Infoln("Test init completed. Starting main test sequence now.")
exitCode := m.Run()
logger.Infoln("Commensing with Tests Tear Down.")
if os.Getenv("TEST_IN_CIRCLE") != "true" {
err = testsTearDown()
if err != nil {
logger.Errorln(err)
os.Exit(1)
}
}
os.Exit(exitCode)
}
示例4: TestMain
func TestMain(m *testing.M) {
runtime.GOMAXPROCS(1)
var logLevel log.LogLevel
var err error
logLevel = 0
// logLevel = 1
// logLevel = 3
log.SetLoggers(logLevel, os.Stdout, os.Stderr)
testsInit()
logger.Infoln("Test init completed. Starting main test sequence now.\n")
var exitCode int
defer func() {
logger.Infoln("Commensing with Tests Tear Down.")
if err = testsTearDown(); err != nil {
logger.Errorln(err)
os.Exit(1)
}
os.Exit(exitCode)
}()
exitCode = m.Run()
}
示例5: TestMain
func TestMain(m *testing.M) {
var logLevel log.LogLevel
logLevel = 0
// logLevel = 1
// logLevel = 3
log.SetLoggers(logLevel, os.Stdout, os.Stderr)
tests.IfExit(testsInit())
exitCode := m.Run()
if os.Getenv("TEST_IN_CIRCLE") != "true" {
tests.IfExit(tests.TestsTearDown())
}
os.Exit(exitCode)
}
示例6: TestMain
func TestMain(m *testing.M) {
var logLevel log.LogLevel
logLevel = 0
//logLevel = 1
// logLevel = 3
log.SetLoggers(logLevel, os.Stdout, os.Stderr)
ifExit(testsInit())
exitCode := m.Run()
logger.Infoln("Commensing with Tests Tear Down.")
if os.Getenv("TEST_IN_CIRCLE") != "true" {
ifExit(testsTearDown())
}
os.Exit(exitCode)
}
示例7: TestMain
func TestMain(m *testing.M) {
runtime.GOMAXPROCS(1)
var logLevel log.LogLevel
var err error
logLevel = 0
// logLevel = 1
// logLevel = 3
log.SetLoggers(logLevel, os.Stdout, os.Stderr)
tests.IfExit(tests.TestsInit("chain"))
logger.Infoln("Test init completed. Starting main test sequence now.\n")
layTestChainToml(chainName)
_ = err
var exitCode int
exitCode = m.Run()
fmt.Println(exitCode)
}
示例8:
Long: `Eris is a platform for building, testing, maintaining, and operating
distributed applications with a blockchain backend. Eris makes it easy
and simple to wrangle the dragons of smart contract blockchains.
Made with <3 by Eris Industries.
Complete documentation is available at https://docs.erisindustries.com
` + "\nVersion:\n " + VERSION,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
var logLevel log.LogLevel
if do.Verbose {
logLevel = 2
} else if do.Debug {
logLevel = 3
}
log.SetLoggers(logLevel, config.GlobalConfig.Writer, config.GlobalConfig.ErrorWriter)
ipfs.IpfsHost = config.GlobalConfig.Config.IpfsHost
util.DockerConnect(do.Verbose, do.MachineName)
dockerVersion, _ := util.DockerClientVersion()
marmot := "Come back after you have upgraded and the marmots will be happy to service your blockchain management needs"
if dockerVersion < dVerMin {
IfExit(fmt.Errorf("Eris requires docker version >= %v\nThe marmots have detected docker version: %v\n%s", dVerMin, dockerVersion, marmot))
}
},
PersistentPostRun: func(cmd *cobra.Command, args []string) {
err := config.SaveGlobalConfig(config.GlobalConfig.Config)
if err != nil {
logger.Errorln(err)