Go 程序调试工具 Go Debug

码农软件 · 软件分类 · 程序调试工具 · 2019-11-29 19:26:51

软件介绍

go-debug 是一个用于条件调试日志记录(Conditional debug logging)的 Go 语言库。

示例代码:

代码示例

package main

import . "github.com/tj/go-debug"
import "time"

var debug = Debug("single")

func main() {
  for {
    debug("sending mail")
    debug("send email to %s", "tobi@segment.io")
    debug("send email to %s", "loki@segment.io")
    debug("send email to %s", "jane@segment.io")
    time.Sleep(500 * time.Millisecond)
  }
}

如果使用 DEBUG=* 环境变量运行程序,将看到:

15:58:15.115 34us   33us   single - sending mail
15:58:15.116 3us    3us    single - send email to tobi@segment.io
15:58:15.116 1us    1us    single - send email to loki@segment.io
15:58:15.116 1us    1us    single - send email to jane@segment.io
15:58:15.620 504ms  504ms  single - sending mail
15:58:15.620 6us    6us    single - send email to tobi@segment.io
15:58:15.620 4us    4us    single - send email to loki@segment.io
15:58:15.620 4us    4us    single - send email to jane@segment.io
15:58:16.123 503ms  503ms  single - sending mail
15:58:16.123 7us    7us    single - send email to tobi@segment.io
15:58:16.123 4us    4us    single - send email to loki@segment.io
15:58:16.123 4us    4us    single - send email to jane@segment.io
15:58:16.625 501ms  501ms  single - sending mail
15:58:16.625 4us    4us    single - send email to tobi@segment.io
15:58:16.625 4us    4us    single - send email to loki@segment.io
15:58:16.625 5us    5us    single - send email to jane@segment.io

本文地址:https://codercto.com/soft/d/20074.html

中国网络媒体的第一个十年

中国网络媒体的第一个十年

彭兰 / 清华大学出版社 / 2005-7 / 35.00元

此书对中国网络媒体的第一个十年这一重要的历史阶段首次进行了全景式、全程式的历史记录,并进行了全面深入的研究,在一定程度上填补了中国网络媒体发展史宏观研究方面的空白。对于网络新闻传播的研究,以及当代中国媒体发展的研究.具有重要的意义。 ——方汉奇 图书目录 绪论 1 第一章 投石问路:中国网络媒体萌芽(1994一1995年) 9 第一节 从实验室走向市场:互联网兴起 10 ......一起来看看 《中国网络媒体的第一个十年》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具