本文整理匯總了Golang中github.com/eris-ltd/eris-cli/Godeps/_workspace/src/github.com/eris-ltd/common/go/log.Flush函數的典型用法代碼示例。如果您正苦於以下問題:Golang Flush函數的具體用法?Golang Flush怎麽用?Golang Flush使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Flush函數的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: testsTearDown
func testsTearDown() error {
DEAD = true
killService("keys")
testKillChain(nil, chainName)
log.Flush()
return os.RemoveAll(erisDir)
}
示例3: IfExit
func IfExit(err error) {
if err != nil {
log.Flush()
fmt.Println(err)
os.Exit(1)
}
}
示例4: ifExit
func ifExit(err error) {
if err != nil {
logger.Errorln(err)
log.Flush()
testsTearDown()
os.Exit(1)
}
}
示例5: fatal
func fatal(t *testing.T, err error) {
if !DEAD {
log.Flush()
testsTearDown()
DEAD = true
panic(err)
}
}
示例6: Exit
func Exit(err error) {
status := 0
if err != nil {
log.Flush()
fmt.Println(err)
status = 1
}
os.Exit(status)
}
示例7: IfExit
func IfExit(err error) {
if err != nil {
logger.Errorln(err)
if err := TestsTearDown(); err != nil {
logger.Errorln(err)
}
log.Flush()
os.Exit(1)
}
}
示例8: Execute
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)
}
log.Flush()
},
}
func Execute() {
InitializeConfig()
AddGlobalFlags()
AddCommands()
ErisCmd.Execute()
}
// Define the commands
func AddCommands() {
buildServicesCommand()
ErisCmd.AddCommand(Services)
buildChainsCommand()