All Projects → kubermatic → glog-gokit

kubermatic / glog-gokit

Licence: MIT license
This packages is a replacement for glog in projects that use the go-kit logger.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to glog-gokit

Android-NativeLogger
Android Logger
Stars: ✭ 21 (+16.67%)
Mutual labels:  logger
telegram-log
Send a Telegram message when your scripts fire an exception or when they finish their execution.
Stars: ✭ 16 (-11.11%)
Mutual labels:  logger
herald
Log annotation for logging frameworks
Stars: ✭ 71 (+294.44%)
Mutual labels:  logger
EventLogger
Log event count and event time in iOS
Stars: ✭ 21 (+16.67%)
Mutual labels:  logger
babel-plugin-js-logger
Babel plugin to enable js-logger in your entire project efficiently.
Stars: ✭ 12 (-33.33%)
Mutual labels:  logger
logger
☠ 😈 👀 Simple,Secure & Undetected (6.11.2017) keylogger for Windows :)
Stars: ✭ 37 (+105.56%)
Mutual labels:  logger
QLogger
Multi-threading logger for Qt applications
Stars: ✭ 46 (+155.56%)
Mutual labels:  logger
log
A simple to use log system, minimalist but with features for debugging and differentiation of messages
Stars: ✭ 21 (+16.67%)
Mutual labels:  logger
LogSwift
Simple yet advanced swift logger
Stars: ✭ 19 (+5.56%)
Mutual labels:  logger
clue
a extremely high performance log library for android. 高性能的Android日志库
Stars: ✭ 27 (+50%)
Mutual labels:  logger
telegram-logger-errors
Telegram logger errors package laravel | Laravel пакет telegram логгер ошибок
Stars: ✭ 15 (-16.67%)
Mutual labels:  logger
hapi-good-winston
A good reporter to send and log events with winston
Stars: ✭ 21 (+16.67%)
Mutual labels:  logger
sprout
Golang logging library supporting log retrieval.
Stars: ✭ 85 (+372.22%)
Mutual labels:  logger
base
OST Base provides advanced Promise Queue Manager and other utilities.
Stars: ✭ 19 (+5.56%)
Mutual labels:  logger
lgr
Basic logger with some extras
Stars: ✭ 33 (+83.33%)
Mutual labels:  logger
RxLogs
An Android & Kotlin Reactive Advanced Logging Framework.
Stars: ✭ 12 (-33.33%)
Mutual labels:  logger
capybara-chromedriver-logger
Enables console.log/error/info output from Javascript feature specs running with Chromedriver
Stars: ✭ 54 (+200%)
Mutual labels:  logger
noodlog
🍜 Parametrized JSON logging library in Golang which lets you obfuscate sensitive data and marshal any kind of content.
Stars: ✭ 42 (+133.33%)
Mutual labels:  logger
Laravel-FluentLogger
fluent logger for laravel (with Monolog handler for Fluentd)
Stars: ✭ 55 (+205.56%)
Mutual labels:  logger
NLog
Flexible logging for C# and Unity
Stars: ✭ 158 (+777.78%)
Mutual labels:  logger

glog-gokit

This packages is a replacement for glog in projects that use the go-kit logger.

It is inspired by istio's glog package for zap: https://github.com/istio/glog

Usage

Override the official glog package with this one. This simply replaces the code in vendor/golang/glog with the code of this package.

With dep

In your Gopkg.toml:

[[override]]
  name = "github.com/golang/glog"
  source = "github.com/kubermatic/glog-gokit"

With Go modules

Add this line to your go.mod file:

replace github.com/golang/glog => github.com/kubermatic/glog-gokit master

In your main.go:

// Import the package like it is original glog
import "github.com/golang/glog"


// Create go-kit logger in your main.go
logger := log.NewLogfmtLogger(log.NewSyncWriter(os.Stdout))
logger = log.With(logger, "ts", log.DefaultTimestampUTC)
logger = log.With(logger, "caller", log.DefaultCaller)
logger = level.NewFilter(logger, level.AllowAll())

// Overriding the default glog with our go-kit glog implementation.
// Thus we need to pass it our go-kit logger object.
glog.SetLogger(logger)

Setting the logger to the glog package MUST happen before using glog in any package.

Function Levels

glog gokit
Info Debug
InfoDepth Debug
Infof Debug
Infoln Debug
Warning Warn
WarningDepth Warn
Warningf Warn
Warningln Warn
Error Error
ErrorDepth Error
Errorf Error
Errorln Error
Exit Error
ExitDepth Error
Exitf Error
Exitln Error
Fatal Error
FatalDepth Error
Fatalf Error
Fatalln Error

This table is rather opinionated and build for use with the Kubernetes' Go client.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].