本文整理汇总了Golang中github.com/davyxu/golog.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: server
package rpc
import (
"testing"
"github.com/davyxu/cellnet"
"github.com/davyxu/cellnet/proto/coredef"
"github.com/davyxu/cellnet/rpc"
"github.com/davyxu/cellnet/socket"
"github.com/davyxu/cellnet/test"
"github.com/davyxu/golog"
)
var log *golog.Logger = golog.New("test")
var signal *test.SignalTester
func server() {
pipe := cellnet.NewEventPipe()
p := socket.NewAcceptor(pipe).Start("127.0.0.1:7201")
rpc.InstallServer(p)
rpc.RegisterMessage(p, coredef.TestEchoACK{}, func(resp rpc.Response, content interface{}) {
msg := content.(*coredef.TestEchoACK)
log.Debugln("server recv:", msg.String())
resp.Feedback(&coredef.TestEchoACK{
Content: msg.String(),
示例2:
package socket
import (
"github.com/davyxu/golog"
)
var log *golog.Logger = golog.New("socket")
示例3:
package gate
import (
"github.com/davyxu/golog"
)
var log *golog.Logger = golog.New("gate")
示例4:
package scanner
import (
"github.com/davyxu/golog"
)
var log *golog.Logger = golog.New("scanner")
示例5:
import (
"bufio"
"flag"
"fmt"
"os"
"github.com/davyxu/golog"
"github.com/davyxu/tabtoy/exportorv1"
"github.com/davyxu/tabtoy/exportorv1/data"
"github.com/davyxu/tabtoy/exportorv2"
"github.com/davyxu/tabtoy/exportorv2/i18n"
"github.com/davyxu/tabtoy/exportorv2/printer"
)
var log *golog.Logger = golog.New("main")
// 显示版本号
var paramVersion = flag.Bool("version", false, "Show version")
// 工作模式
var paramMode = flag.String("mode", "", "mode: exportorv1, exportorv2")
// 并发导出,提高导出速度, 输出日志会混乱
var paramPara = flag.Bool("para", false, "parallel export by your cpu count")
// ============================v1 版本参数============================
// 开启调试信息
var paramDebugLevel = flag.Int("debug", 0, "[v1] show debug info")
示例6:
package data
import (
"github.com/davyxu/golog"
)
var log *golog.Logger = golog.New("data")
// 级别越高,可见信息越多(0~5)
var DebuggingLevel int
示例7:
package printer
import (
"github.com/davyxu/golog"
)
var log *golog.Logger = golog.New("printer")
示例8:
package exportor
import (
"github.com/davyxu/golog"
)
var log *golog.Logger = golog.New("exportor")
示例9:
package pbmeta
import (
"github.com/davyxu/golog"
)
var log *golog.Logger = golog.New("pbmeta")