本文整理匯總了Golang中github.com/koding/logging.Logger.Fatal方法的典型用法代碼示例。如果您正苦於以下問題:Golang Logger.Fatal方法的具體用法?Golang Logger.Fatal怎麽用?Golang Logger.Fatal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/koding/logging.Logger
的用法示例。
在下文中一共展示了Logger.Fatal方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: MustInitBongo
func MustInitBongo(
appName string,
eventExchangeName string,
c *Config,
log logging.Logger,
metrics *metrics.Metrics,
debug bool,
) *bongo.Bongo {
rmqConf := &rabbitmq.Config{
Host: c.Mq.Host,
Port: c.Mq.Port,
Username: c.Mq.Login,
Password: c.Mq.Password,
Vhost: c.Mq.Vhost,
}
bConf := &broker.Config{
RMQConfig: rmqConf,
ExchangeName: eventExchangeName,
QOS: 10,
}
db := MustInitDB(c, log, debug)
broker := broker.New(appName, bConf, log)
// set metrics for broker
broker.Metrics = metrics
bongo := bongo.New(broker, db, log)
err := bongo.Connect()
if err != nil {
log.Fatal("Error while starting bongo, exiting err: %s", err.Error())
}
log.Info("Caching disabled: %v", c.DisableCaching)
if !c.DisableCaching {
redisConn, err := InitRedisConn(c)
if err != nil {
log.Critical("Bongo couldnt connect to redis, caching will not be available Err: %s", err.Error())
} else {
bongo.Cache = redisConn
}
}
return bongo
}