当前位置: 首页>>代码示例>>Golang>>正文


Golang golog.New函数代码示例

本文整理汇总了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(),
开发者ID:faquiiR,项目名称:cellnet,代码行数:31,代码来源:rpc_test.go

示例2:

package socket

import (
	"github.com/davyxu/golog"
)

var log *golog.Logger = golog.New("socket")
开发者ID:CaiGuaiNi,项目名称:cellnet,代码行数:7,代码来源:log.go

示例3:

package gate

import (
	"github.com/davyxu/golog"
)

var log *golog.Logger = golog.New("gate")
开发者ID:bobbyzhu,项目名称:cellnet,代码行数:7,代码来源:log.go

示例4:

package scanner

import (
	"github.com/davyxu/golog"
)

var log *golog.Logger = golog.New("scanner")
开发者ID:jwk000,项目名称:tabtoy,代码行数:7,代码来源:log.go

示例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")
开发者ID:davyxu,项目名称:tabtoy,代码行数:29,代码来源:main.go

示例6:

package data

import (
	"github.com/davyxu/golog"
)

var log *golog.Logger = golog.New("data")

// 级别越高,可见信息越多(0~5)
var DebuggingLevel int
开发者ID:davyxu,项目名称:tabtoy,代码行数:10,代码来源:log.go

示例7:

package printer

import (
	"github.com/davyxu/golog"
)

var log *golog.Logger = golog.New("printer")
开发者ID:davyxu,项目名称:tabtoy,代码行数:7,代码来源:log.go

示例8:

package exportor

import (
	"github.com/davyxu/golog"
)

var log *golog.Logger = golog.New("exportor")
开发者ID:davyxu,项目名称:tabtoy,代码行数:7,代码来源:log.go

示例9:

package pbmeta

import (
	"github.com/davyxu/golog"
)

var log *golog.Logger = golog.New("pbmeta")
开发者ID:davyxu,项目名称:pbmeta,代码行数:7,代码来源:log.go


注:本文中的github.com/davyxu/golog.New函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。