本文整理汇总了Golang中github.com/xh3b4sd/anna/log.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: DefaultConfig
// DefaultConfig provides a default configuration to create a new server object
// by best effort.
func DefaultConfig() Config {
newInstrumentation, err := memory.NewInstrumentation(memory.DefaultInstrumentationConfig())
if err != nil {
panic(err)
}
newLogControl, err := logcontrol.NewControl(logcontrol.DefaultControlConfig())
if err != nil {
panic(err)
}
newTextInterface, err := text.NewServer(text.DefaultServerConfig())
if err != nil {
panic(err)
}
newConfig := Config{
// Dependencies.
Instrumentation: newInstrumentation,
Log: log.New(log.DefaultConfig()),
LogControl: newLogControl,
TextInterface: newTextInterface,
// Settings.
GRPCAddr: "127.0.0.1:9119",
HTTPAddr: "127.0.0.1:9120",
}
return newConfig
}
开发者ID:xh3b4sd,项目名称:anna,代码行数:34,代码来源:server.go
示例2: DefaultConfig
// DefaultConfig provides a default configuration to create a new command line
// object by best effort.
func DefaultConfig() Config {
newLogControl, err := logcontrol.NewControl(logcontrol.DefaultControlConfig())
if err != nil {
panic(err)
}
newTextInterface, err := text.NewClient(text.DefaultClientConfig())
if err != nil {
panic(err)
}
newConfig := Config{
// Dependencies.
Log: log.New(log.DefaultConfig()),
LogControl: newLogControl,
ServiceCollection: service.MustNewCollection(),
TextInterface: newTextInterface,
// Settings.
Flags: Flags{},
SessionID: string(id.MustNewID()),
Version: version,
}
return newConfig
}
开发者ID:xh3b4sd,项目名称:anna,代码行数:28,代码来源:main.go
示例3: DefaultStorageConfig
// DefaultStorageConfig provides a default configuration to create a new memory
// storage object by best effort.
func DefaultStorageConfig() StorageConfig {
newConfig := StorageConfig{
// Dependencies.
Log: log.New(log.DefaultConfig()),
}
return newConfig
}
开发者ID:xh3b4sd,项目名称:anna,代码行数:10,代码来源:storage.go
示例4: DefaultServerConfig
// DefaultServerConfig provides a default configuration to create a new text
// interface object by best effort.
func DefaultServerConfig() ServerConfig {
newConfig := ServerConfig{
Log: log.New(log.DefaultConfig()),
ServiceCollection: service.MustNewCollection(),
}
return newConfig
}
开发者ID:xh3b4sd,项目名称:anna,代码行数:10,代码来源:server.go
示例5: DefaultConfig
// DefaultConfig provides a default configuration to create a new CLG object by
// best effort.
func DefaultConfig() Config {
newConfig := Config{
// Dependencies.
ServiceCollection: service.MustNewCollection(),
Log: log.New(log.DefaultConfig()),
StorageCollection: storage.MustNewCollection(),
}
return newConfig
}
开发者ID:xh3b4sd,项目名称:anna,代码行数:12,代码来源:generated_calculate.go
示例6: DefaultConfig
// DefaultConfig provides a default configuration to create a new CLG
// collection object by best effort.
func DefaultConfig() Config {
newIDService, err := id.New(id.DefaultConfig())
if err != nil {
panic(err)
}
newConfig := Config{
// Dependencies.
IDService: newIDService,
Log: log.New(log.DefaultConfig()),
}
return newConfig
}
开发者ID:xh3b4sd,项目名称:anna,代码行数:16,代码来源:collection.go
示例7: DefaultConfig
// DefaultConfig provides a default configuration to create a new network
// object by best effort.
func DefaultConfig() Config {
newConfig := Config{
// Dependencies.
Activator: activator.MustNew(),
ServiceCollection: service.MustNewCollection(),
Forwarder: forwarder.MustNew(),
Log: log.New(log.DefaultConfig()),
StorageCollection: storage.MustNewCollection(),
Tracker: tracker.MustNew(),
// Settings.
Delay: 0,
}
return newConfig
}
开发者ID:xh3b4sd,项目名称:anna,代码行数:18,代码来源:network.go
示例8: Test_RedisStorage_retryErrorLogger
func Test_RedisStorage_retryErrorLogger(t *testing.T) {
newRootLogger := testMustNewRootLogger(t)
newLogConfig := log.DefaultConfig()
newLogConfig.RootLogger = newRootLogger
newLog := log.New(newLogConfig)
newConfig := DefaultStorageConfig()
newConfig.Log = newLog
newStorage, err := NewStorage(newConfig)
if err != nil {
t.Fatal("expected", nil, "got", err)
}
newStorage.(*storage).retryErrorLogger(invalidConfigError, 0)
result := newRootLogger.(*rootLogger).ArgsToString()
if !strings.Contains(result, invalidConfigError.Error()) {
t.Fatal("expected", invalidConfigError.Error(), "got", result)
}
}
开发者ID:xh3b4sd,项目名称:anna,代码行数:21,代码来源:common_test.go
示例9: DefaultControlConfig
// DefaultControlConfig provides a default configuration to create a new log control
// object by best effort.
func DefaultControlConfig() ControlConfig {
return ControlConfig{
// Dependencies.
Log: log.New(log.DefaultConfig()),
}
}
开发者ID:xh3b4sd,项目名称:anna,代码行数:8,代码来源:control.go
注:本文中的github.com/xh3b4sd/anna/log.New函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论