當前位置: 首頁>>代碼示例>>Golang>>正文


Golang log.SetLoggers函數代碼示例

本文整理匯總了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)
}
開發者ID:alexandrev,項目名稱:eris-cli,代碼行數:26,代碼來源:migrate_dirs_test.go

示例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)
}
開發者ID:alexandrev,項目名稱:eris-cli,代碼行數:25,代碼來源:files_test.go

示例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)
}
開發者ID:slowtokyo,項目名稱:eris-cli,代碼行數:26,代碼來源:chains_test.go

示例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()
}
開發者ID:jeffanthony,項目名稱:eris-cli,代碼行數:27,代碼來源:chains_test.go

示例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)
}
開發者ID:alexandrev,項目名稱:eris-cli,代碼行數:19,代碼來源:keys_test.go

示例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)
}
開發者ID:kustomzone,項目名稱:eris-cli,代碼行數:20,代碼來源:services_test.go

示例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)
}
開發者ID:alexandrev,項目名稱:eris-cli,代碼行數:22,代碼來源:chains_test.go

示例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)
開發者ID:alexandrev,項目名稱:eris-cli,代碼行數:31,代碼來源:eris.go


注:本文中的github.com/eris-ltd/eris-cli/Godeps/_workspace/src/github.com/eris-ltd/common/go/log.SetLoggers函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。