Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: go/src/infra/libs/logging/logging.go

Issue 1149313002: go: Replace Logrus with go-logging. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: typo Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « go/src/infra/libs/logging/go-logging.go ('k') | go/src/infra/libs/logging/logrus.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/libs/logging/logging.go
diff --git a/go/src/infra/libs/logging/logging.go b/go/src/infra/libs/logging/logging.go
index cc31f0eb80615cd1730ee79666f2dca9a304ab25..6eb98513bde3406dce62699afe29848c85017eae 100644
--- a/go/src/infra/libs/logging/logging.go
+++ b/go/src/infra/libs/logging/logging.go
@@ -3,22 +3,23 @@
// found in the LICENSE file.
/*
-Package logging defines Logger interface with implementations on top of Logrus
-library and Appengine context. Unfortunately standard library doesn't define
-any Logger interface (only struct). And even worse: GAE logger is exposing
-different set of methods. Some additional layer is needed to unify the logging.
+Package logging defines Logger interface with implementations on top of
+go-logging library and Appengine context. Unfortunately standard library doesn't
+define any Logger interface (only struct). And even worse: GAE logger is
+exposing different set of methods. Some additional layer is needed to unify
+the logging.
Package logging is intended to be used from packages that support both local and
GAE environments. Such packages should not use global logger but must accept
instances of Logger interface as parameters in functions. Then callers can pass
-logrus.Logger or appengine.Context depending on where the code is running.
+DefaultLogger or appengine.Context depending on where the code is running.
Libraries under infra/libs/* MUST use infra/libs/logger instead of directly
-calling to Logrus library.
+calling to a logging library.
*/
package logging
-// Logger is interface implemented by both logrus.Logger and appengine.Context,
+// Logger is interface implemented by both DefaultLogger and appengine.Context,
// and thus it can be used in libraries that expect to be called from both kinds
// of environments.
type Logger interface {
@@ -34,19 +35,6 @@ type Logger interface {
}
// DefaultLogger is logger to use if no specialized logger is provided. In local
-// environment it is Logrus logger, on GAE it is null logger (since GAE logger
-// requires active appengine.Context).
+// environment it is backed by go-logging, on GAE it is null logger (since GAE
+// logger requires active appengine.Context).
var DefaultLogger Logger
-
-// IsTerminal is true if current process is attached to an interactive terminal.
-var IsTerminal bool
-
-// Infof formats its arguments according to the format, analogous to fmt.Printf,
-// and records the text as a log message at Info level.
-func Infof(format string, args ...interface{}) { DefaultLogger.Infof(format, args...) }
-
-// Warningf is like Infof, but logs at Warning level.
-func Warningf(format string, args ...interface{}) { DefaultLogger.Warningf(format, args...) }
-
-// Errorf is like Infof, but logs at Error level.
-func Errorf(format string, args ...interface{}) { DefaultLogger.Errorf(format, args...) }
« no previous file with comments | « go/src/infra/libs/logging/go-logging.go ('k') | go/src/infra/libs/logging/logrus.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698