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


Golang flogging.LoggingInit函數代碼示例

本文整理匯總了Golang中github.com/hyperledger/fabric/flogging.LoggingInit函數的典型用法代碼示例。如果您正苦於以下問題:Golang LoggingInit函數的具體用法?Golang LoggingInit怎麽用?Golang LoggingInit使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了LoggingInit函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: TestLoggingLevelForUnknownCommandGoesToDefault

func TestLoggingLevelForUnknownCommandGoesToDefault(t *testing.T) {
	viper.Reset()

	flogging.LoggingInit("unknown command")

	assertDefaultLoggingLevel(t, flogging.DefaultLoggingLevel())
}
開發者ID:hyperledger,項目名稱:fabric,代碼行數:7,代碼來源:logging_test.go

示例2: TestLoggingLevelDefault

func TestLoggingLevelDefault(t *testing.T) {
	viper.Reset()

	flogging.LoggingInit("")

	assertDefaultLoggingLevel(t, flogging.DefaultLoggingLevel())
}
開發者ID:hyperledger,項目名稱:fabric,代碼行數:7,代碼來源:logging_test.go

示例3: TestLoggingLevelForSpecificModule

func TestLoggingLevelForSpecificModule(t *testing.T) {
	viper.Reset()
	viper.Set("logging_level", "core=info")

	flogging.LoggingInit("")

	assertModuleLoggingLevel(t, "core", logging.INFO)
}
開發者ID:hyperledger,項目名稱:fabric,代碼行數:8,代碼來源:logging_test.go

示例4: TestLoggingLevelOtherThanDefault

func TestLoggingLevelOtherThanDefault(t *testing.T) {
	viper.Reset()
	viper.Set("logging_level", "warning")

	flogging.LoggingInit("")

	assertDefaultLoggingLevel(t, logging.WARNING)
}
開發者ID:hyperledger,項目名稱:fabric,代碼行數:8,代碼來源:logging_test.go

示例5: TestLoggingLevelInvalidEmptyModule

func TestLoggingLevelInvalidEmptyModule(t *testing.T) {
	viper.Reset()
	viper.Set("logging_level", "=warning")

	flogging.LoggingInit("")

	assertDefaultLoggingLevel(t, flogging.DefaultLoggingLevel())
}
開發者ID:hyperledger,項目名稱:fabric,代碼行數:8,代碼來源:logging_test.go

示例6: TestLoggingLevelInvalidModules

func TestLoggingLevelInvalidModules(t *testing.T) {
	viper.Reset()
	viper.Set("logging_level", "core=invalid")

	flogging.LoggingInit("")

	assertDefaultLoggingLevel(t, flogging.DefaultLoggingLevel())
}
開發者ID:hyperledger,項目名稱:fabric,代碼行數:8,代碼來源:logging_test.go

示例7: TestLoggingLevelForSpecificCommand

func TestLoggingLevelForSpecificCommand(t *testing.T) {
	viper.Reset()
	viper.Set("logging.node", "error")

	flogging.LoggingInit("node")

	assertDefaultLoggingLevel(t, logging.ERROR)
}
開發者ID:hyperledger,項目名稱:fabric,代碼行數:8,代碼來源:logging_test.go

示例8: TestLoggingLevelInvalidModuleSyntax

func TestLoggingLevelInvalidModuleSyntax(t *testing.T) {
	viper.Reset()
	viper.Set("logging_level", "type=warn=again")

	flogging.LoggingInit("")

	assertDefaultLoggingLevel(t, flogging.DefaultLoggingLevel())
}
開發者ID:hyperledger,項目名稱:fabric,代碼行數:8,代碼來源:logging_test.go

示例9: TestLoggingLevelForModuleWithDefaultAtEnd

func TestLoggingLevelForModuleWithDefaultAtEnd(t *testing.T) {
	viper.Reset()
	viper.Set("logging_level", "test=warning:info")

	flogging.LoggingInit("")

	assertDefaultLoggingLevel(t, logging.INFO)
	assertModuleLoggingLevel(t, "test", logging.WARNING)
}
開發者ID:hyperledger,項目名稱:fabric,代碼行數:9,代碼來源:logging_test.go

示例10: TestLoggingLevelForMultipleModulesAtSameLevel

func TestLoggingLevelForMultipleModulesAtSameLevel(t *testing.T) {
	viper.Reset()
	viper.Set("logging_level", "core,test=warning")

	flogging.LoggingInit("")

	assertModuleLoggingLevel(t, "core", logging.WARNING)
	assertModuleLoggingLevel(t, "test", logging.WARNING)
}
開發者ID:hyperledger,項目名稱:fabric,代碼行數:9,代碼來源:logging_test.go

示例11: TestLoggingLeveltForMultipleModules

func TestLoggingLeveltForMultipleModules(t *testing.T) {
	viper.Reset()
	viper.Set("logging_level", "core=warning:test=debug")

	flogging.LoggingInit("")

	assertModuleLoggingLevel(t, "core", logging.WARNING)
	assertModuleLoggingLevel(t, "test", logging.DEBUG)
}
開發者ID:hyperledger,項目名稱:fabric,代碼行數:9,代碼來源:logging_test.go

示例12: NewCA

// NewCA sets up a new CA.
func NewCA(name string, initTables TableInitializer) *CA {
	ca := new(CA)
	flogging.LoggingInit("ca")
	ca.path = filepath.Join(rootPath, caDir)

	if _, err := os.Stat(ca.path); err != nil {
		caLogger.Info("Fresh start; creating databases, key pairs, and certificates.")

		if err := os.MkdirAll(ca.path, 0755); err != nil {
			caLogger.Panic(err)
		}
	}

	// open or create certificate database
	db, err := sql.Open("sqlite3", ca.path+"/"+name+".db")
	if err != nil {
		caLogger.Panic(err)
	}

	if err = db.Ping(); err != nil {
		caLogger.Panic(err)
	}

	if err = initTables(db); err != nil {
		caLogger.Panic(err)
	}
	ca.db = db

	// read or create signing key pair
	priv, err := ca.readCAPrivateKey(name)
	if err != nil {
		priv = ca.createCAKeyPair(name)
	}
	ca.priv = priv

	// read CA certificate, or create a self-signed CA certificate
	raw, err := ca.readCACertificate(name)
	if err != nil {
		raw = ca.createCACertificate(name, &ca.priv.PublicKey)
	}
	cert, err := x509.ParseCertificate(raw)
	if err != nil {
		caLogger.Panic(err)
	}

	ca.raw = raw
	ca.cert = cert

	return ca
}
開發者ID:yoshiharay,項目名稱:fabric,代碼行數:51,代碼來源:ca.go

示例13: NewTCA

// NewTCA sets up a new TCA.
func NewTCA(eca *ECA) *TCA {
	tca := &TCA{NewCA("tca", initializeTCATables), eca, nil, nil, nil, nil}
	flogging.LoggingInit("tca")

	err := tca.readHmacKey()
	if err != nil {
		tcaLogger.Panic(err)
	}

	err = tca.readRootPreKey()
	if err != nil {
		tcaLogger.Panic(err)
	}

	err = tca.initializePreKeyTree()
	if err != nil {
		tcaLogger.Panic(err)
	}
	return tca
}
開發者ID:yoshiharay,項目名稱:fabric,代碼行數:21,代碼來源:tca.go

示例14: NewACA

// NewACA sets up a new ACA.
func NewACA() *ACA {
	aca := &ACA{CA: NewCA("aca", initializeACATables)}
	flogging.LoggingInit("aca")
	return aca
}
開發者ID:yoshiharay,項目名稱:fabric,代碼行數:6,代碼來源:aca.go

示例15: NewTLSCA

// NewTLSCA sets up a new TLSCA.
//
func NewTLSCA(eca *ECA) *TLSCA {
	tlsca := &TLSCA{NewCA("tlsca", initializeTLSCATables), eca, nil}
	flogging.LoggingInit("tlsca")

	return tlsca
}
開發者ID:yoshiharay,項目名稱:fabric,代碼行數:8,代碼來源:tlsca.go


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