Leveled execution logs for Go

Related tags

glog
Overview
glog
====

Leveled execution logs for Go.

This is an efficient pure Go implementation of leveled logs in the
manner of the open source C++ package
	https://github.com/google/glog

By binding methods to booleans it is possible to use the log package
without paying the expense of evaluating the arguments to the log.
Through the -vmodule flag, the package also provides fine-grained
control over logging at the file level.

The comment from glog.go introduces the ideas:

	Package glog implements logging analogous to the Google-internal
	C++ INFO/ERROR/V setup.  It provides functions Info, Warning,
	Error, Fatal, plus formatting variants such as Infof. It
	also provides V-style logging controlled by the -v and
	-vmodule=file=2 flags.
	
	Basic examples:
	
		glog.Info("Prepare to repel boarders")
	
		glog.Fatalf("Initialization failed: %s", err)
	
	See the documentation for the V function for an explanation
	of these examples:
	
		if glog.V(2) {
			glog.Info("Starting transaction...")
		}
	
		glog.V(2).Infoln("Processed", nItems, "elements")


The repository contains an open source version of the log package
used inside Google. The master copy of the source lives inside
Google, not here. The code in this repo is for export only and is not itself
under development. Feature requests will be ignored.

Send bug reports to [email protected]
Issues
  • Update README file to Markdown 📃

    Update README file to Markdown 📃

    Since the README file of this repository was 5 years old. I took the initiative of creating this update in formatting using markdown. If you need anything else please respond to this pull request so I can change it.

    Leave your thoughts below about this change. I would appreciate it if my pull request is accepted since this is my first contribution to golang. I would certainly like to contribute more.

    Best Regards

    opened by joaoofreitas 7
  • Export glog bugfix.

    Export glog bugfix.

    @robpike This is an export of an internal bug fix. The original author is @Sajmani

    Fix problem that -log_dir will not be respected when anything is logged before flag.Parse().

    Before this change, premature logging resulted into log files being put in the default location (e.g. /tmp), but not the one specified by the log_dir flag.

    After this change, premature logging will not result into the creation of the log files yet. Instead, the log message will be printed to stderr.

    opened by michael-berlin 6
  • Add examples of flag use to README

    Add examples of flag use to README

    It took me forever to figure out how to use the flag functionality; even in the generate godoc for glog, the instruction to call flag.Parse() is very easy to overlook.

    By putting the information in the pull request in the README it will help prevent confusion to people either new to golang or who lack knowledge of the flag package.

    opened by jrmiller82 5
  • add log level with TRACE and DEBUG

    add log level with TRACE and DEBUG

    In most cases, we need log levels in development, such as debug and trace.

    opened by lingdor 5
  • add goroutine id to each line

    add goroutine id to each line

    opened by silentred 4
  • #fix After setting the output directory, you should not send logs to …

    #fix After setting the output directory, you should not send logs to …

    …the temporary directory.

    HI!,I think setting the output directory, you should not send logs to the temporary directory.

    opened by farmerx 4
  • Glogger type to allow adding prefixes to logs

    Glogger type to allow adding prefixes to logs

    Glogger contains a copy of the exported glog logging functions but it turns them into methods and allows adding prefixes to the logs. This allows "namespacing" the printout with something such as the name of the function that triggered it.

    opened by rodney-b 4
  • Run gofmt -s -w

    Run gofmt -s -w

    opened by sargun 4
  • code style by golint

    code style by golint

    opened by ericuni 4
  • Feature non-blocking logging

    Feature non-blocking logging

    Add wrapper running output in go routines to avoid blocking on a locked or heavily loaded file system.

    opened by khellan 4
  • Fix comment error

    Fix comment error

    There exists an error in doc of Verbose Line997 in glog.go file, which is mismatch with the meaning of code.

    opened by Spground 2
  • Add go.mod

    Add go.mod

    Tested to work on go1.11 with:

    go get golang.org/dl/go1.11 go1.11 download go1.11 test

    opened by maruel 0
  • update glog.go

    update glog.go

    Added support for Setting threshold level using environment variables

    opened by ashuangiras 3
  • Omit values from range loop

    Omit values from range loop

    Just a tiny bit neater to read.

    opened by muesli 0
  • add flushinterval flag

    add flushinterval flag

    opened by guangxuewu 2
  • installation

    installation

    just looking for quick installation instructions

    also an issues tab in the issue tracker wouldn't kill anyone would it

    opened by ORESoftware 1
Owner
Go
The Go Programming Language
Go
Parse awesome-go README file and generate a new README file with repo info.

Awesome Go Extra All data are from awesome-go and GitHub API. Audio and Music Libraries for manipulating audio. Name Description Star Open Issues Crea

Wendell Sun 13 Jul 24, 2021
Leveled execution logs for Go

glog ==== Leveled execution logs for Go. This is an efficient pure Go implementation of leveled logs in the manner of the open source C++ package h

Go 2.8k Jul 22, 2021
Like Prometheus, but for logs.

Loki: like Prometheus, but for logs. Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by Prometheus. It

Grafana Labs 13.4k Jul 23, 2021
A simple logging interface for Go

A more minimal logging API for Go Before you consider this package, please read this blog post by the inimitable Dave Cheney. I really appreciate what

null 430 Jul 23, 2021
raft variant with topology order logs

Safe: A log that is safe if it has been replicated to a quorum, no matter whether or not the committed flag is set on any replica.

null 27 Apr 17, 2021
Logur is an opinionated collection of logging best practices

Logur is an opinionated collection of logging best practices. Table of Contents Preface Features Installation Usage FAQ Why not just X logger? Why not

Logur 129 Jul 16, 2021
CoLog is a prefix-based leveled execution log for Go

What's CoLog? CoLog is a prefix-based leveled execution log for Go. It's heavily inspired by Logrus and aims to offer similar features by parsing the

null 157 May 17, 2021
A minimal and extensible structured logger

⚠️ PRE-RELEASE ⚠️ DO NOT IMPORT THIS MODULE YOUR PROJECT WILL BREAK package log package log provides a minimal interface for structured logging in ser

Go kit 54 Jul 21, 2021
GoVector is a vector clock logging library written in Go.

GoVector is a vector clock logging library written in Go. The vector clock algorithm is used to order events in distributed systems in the absence of a centralized clock. GoVector implements the vector clock algorithm and provides feature-rich logging and encoding infrastructure.

Distributed clocks 155 Jul 16, 2021
Blazing fast, structured, leveled logging in Go.

⚡ zap Blazing fast, structured, leveled logging in Go. Installation go get -u go.uber.org/zap Note that zap only supports the two most recent minor ve

Uber Go 13.2k Jul 23, 2021
Simple, customizable, leveled and efficient logging in Go

log Simple, customizable, leveled and efficient logging in Go Installation go get -u github.com/ermanimer/log Features log is a simple logging package

Erman İmer 22 Jul 13, 2021
Structured log interface

Structured log interface Package log provides the separation of the logging interface from its implementation and decouples the logger backend from yo

teris.io 24 Jan 3, 2021
Minimalistic logging library for Go.

logger Minimalistic logging library for Go. Blog Post Features: Advanced output filters (package and/or level) Attributes Timers for measuring perform

Azer Koçulu 148 Mar 29, 2021
Port of perl5 File::RotateLogs to Go

file-rotatelogs Provide an io.Writer that periodically rotates log files from within the application. Port of File::RotateLogs from Perl to Go. SYNOPS

null 715 Jul 23, 2021