當前位置: 首頁>>代碼示例>>Golang>>正文


Golang glog.InfoDepth函數代碼示例

本文整理匯總了Golang中github.com/golang/glog.InfoDepth函數的典型用法代碼示例。如果您正苦於以下問題:Golang InfoDepth函數的具體用法?Golang InfoDepth怎麽用?Golang InfoDepth使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了InfoDepth函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: Log

// Log is intended to be called once at the end of your request handler, via defer
func (rl *respLogger) Log() {
	latency := time.Since(rl.startTime)
	if glog.V(2) {
		if !rl.hijacked {
			glog.InfoDepth(1, fmt.Sprintf("%s %s: (%v) %v%v%v [%s %s]", rl.req.Method, rl.req.RequestURI, latency, rl.status, rl.statusStack, rl.addedInfo, rl.req.Header["User-Agent"], rl.req.RemoteAddr))
		} else {
			glog.InfoDepth(1, fmt.Sprintf("%s %s: (%v) hijacked [%s %s]", rl.req.Method, rl.req.RequestURI, latency, rl.req.Header["User-Agent"], rl.req.RemoteAddr))
		}
	}
}
開發者ID:XbinZh,項目名稱:kubernetes,代碼行數:11,代碼來源:log.go

示例2: glogFileRangePairSideBySide

func glogFileRangePairSideBySide(frp FileRangePair, optionalConfig *SideBySideConfig) {
	aRange, bRange := frp.ARange(), frp.BRange()
	mismatch := &BlockPair{
		AIndex:  aRange.FirstIndex(),
		ALength: aRange.Length(),
		BIndex:  bRange.FirstIndex(),
		BLength: bRange.Length(),
	}
	pairs := BlockPairs{mismatch}

	if optionalConfig == nil {
		optionalConfig = &SideBySideConfig{
			DisplayColumns:       128,
			DisplayLineNumbers:   true,
			WrapLongLines:        true,
			SpacesPerTab:         2,
			ContextLines:         0,
			ZeroBasedLineNumbers: true,
		}
	}

	// Maybe split if glog can't take too large a string?
	s := FormatSideBySideToString(aRange.File(), bRange.File(), pairs, false, *optionalConfig)
	glog.InfoDepth(1, "\n\n", s, "\n\n")
}
開發者ID:zlongshen,項目名稱:diffmerge,代碼行數:25,代碼來源:file_range_pair.go

示例3: Flush

// Flush implements http.Flusher even if the underlying http.Writer doesn't implement it.
// Flush is used for streaming purposes and allows to flush buffered data to the client.
func (rl *respLogger) Flush() {
	if flusher, ok := rl.w.(http.Flusher); ok {
		flusher.Flush()
	} else if glog.V(2) {
		glog.InfoDepth(1, fmt.Sprintf("Unable to convert %+v into http.Flusher", rl.w))
	}
}
開發者ID:chenzhen411,項目名稱:kubernetes,代碼行數:9,代碼來源:log.go

示例4: Infof

// Infof logs an info message with caller information.
func Infof(format string, args ...interface{}) {
	msg := format
	if len(args) > 0 {
		msg = fmt.Sprintf(format, args...)
	}

	log.InfoDepth(1, fmt.Sprintf("%s: %s", funcName(), msg))
}
開發者ID:eolexe,項目名稱:martian,代碼行數:9,代碼來源:log.go

示例5: appendLogs

func (r *diagnosticResultImpl) appendLogs(stackDepth int, entry ...log.Entry) {
	if r.logs == nil {
		r.logs = make([]log.Entry, 0)
	}
	r.logs = append(r.logs, entry...)
	// glog immediately for debugging when a diagnostic silently chokes
	for _, entry := range entry {
		if glog.V(glog.Level(6 - entry.Level.Level)) {
			glog.InfoDepth(stackDepth, entry.Message)
		}
	}
}
開發者ID:RomainVabre,項目名稱:origin,代碼行數:12,代碼來源:diagnostic.go

示例6: glogSideBySide

func glogSideBySide(aFile, bFile *File, pairs []*BlockPair, aIsPrimary bool,
	optionalConfig *SideBySideConfig) {
	if optionalConfig == nil {
		optionalConfig = &SideBySideConfig{
			DisplayColumns:       128,
			DisplayLineNumbers:   true,
			WrapLongLines:        true,
			SpacesPerTab:         2,
			ContextLines:         0,
			ZeroBasedLineNumbers: true,
		}
		if DefaultSideBySideConfig.DisplayColumns > optionalConfig.DisplayColumns {
			optionalConfig.DisplayColumns = DefaultSideBySideConfig.DisplayColumns
		}
	}
	// Maybe split if glog can't take too large a string?
	s := FormatSideBySideToString(aFile, bFile, pairs, aIsPrimary, *optionalConfig)
	glog.InfoDepth(1, "\n\n", s, "\n\n")
}
開發者ID:zlongshen,項目名稱:diffmerge,代碼行數:19,代碼來源:side_by_side.go

示例7: Addf

// Addf logs info immediately.
func (passthroughLogger) Addf(format string, data ...interface{}) {
	glog.InfoDepth(1, fmt.Sprintf(format, data...))
}
開發者ID:chenzhen411,項目名稱:kubernetes,代碼行數:4,代碼來源:log.go

示例8: Info

func (gl GLogger) Info(f string, a ...interface{}) {
	glog.InfoDepth(3, fmt.Sprintf(f, a...))
}
開發者ID:codingjester,項目名稱:goirc,代碼行數:3,代碼來源:glog.go

示例9: Debug

func (gl GLogger) Debug(f string, a ...interface{}) {
	// GLog doesn't have a "Debug" level, so use V(2) instead.
	if glog.V(2) {
		glog.InfoDepth(3, fmt.Sprintf(f, a...))
	}
}
開發者ID:codingjester,項目名稱:goirc,代碼行數:6,代碼來源:glog.go

示例10: Println

func (g *glogger) Println(args ...interface{}) {
	glog.InfoDepth(2, fmt.Sprintln(args...))
}
開發者ID:tamird,項目名稱:grpc-go,代碼行數:3,代碼來源:glogger.go

示例11: Infof

// Infof implements log.Infof for a Suite.
func (t *Suite) Infof(format string, args ...interface{}) {
	log.InfoDepth(1, fmt.Sprintf(format, args...))
}
開發者ID:mehulsbhatt,項目名稱:drydock,代碼行數:4,代碼來源:test_suite.go

示例12: Log

// Log is intended to be called once at the end of your request handler, via defer
func (rl *respLogger) Log() {
	latency := time.Since(rl.startTime)
	if glog.V(2) {
		glog.InfoDepth(1, fmt.Sprintf("%s %s: (%v) %v%v%v", rl.req.Method, rl.req.RequestURI, latency, rl.status, rl.statusStack, rl.addedInfo))
	}
}
開發者ID:hortonworks,項目名稱:kubernetes-yarn,代碼行數:7,代碼來源:log.go

示例13: InfoDepth

// InfoDepth is part of the Logger interface.
func (cl *ConsoleLogger) InfoDepth(depth int, s string) {
	log.InfoDepth(1+depth, s)
}
開發者ID:aaijazi,項目名稱:vitess,代碼行數:4,代碼來源:console_logger.go

示例14: Infof

func (Logger) Infof(format string, args ...interface{}) {
	glog.InfoDepth(3, fmt.Sprintf(format, args...))
}
開發者ID:RamboWANG,項目名稱:cayley,代碼行數:3,代碼來源:glog.go

示例15: Infof

// Infof is part of the Logger interface
func (cl ConsoleLogger) Infof(format string, v ...interface{}) {
	log.InfoDepth(2, fmt.Sprintf(format, v...))
}
開發者ID:littleyang,項目名稱:vitess,代碼行數:4,代碼來源:console_logger.go


注:本文中的github.com/golang/glog.InfoDepth函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。