https://github.com/landonia/golog
A simple log that will print using colours to a specific stream
https://github.com/landonia/golog
colours go golang golog logging logging-library
Last synced: 6 months ago
JSON representation
A simple log that will print using colours to a specific stream
- Host: GitHub
- URL: https://github.com/landonia/golog
- Owner: landonia
- License: bsd-3-clause
- Created: 2016-12-15T15:05:49.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-01-05T19:29:09.000Z (over 8 years ago)
- Last Synced: 2024-06-20T07:56:57.014Z (about 2 years ago)
- Topics: colours, go, golang, golog, logging, logging-library
- Language: Go
- Size: 116 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# golog
[](https://goreportcard.com/report/github.com/landonia/golog)
[](https://godoc.org/github.com/landonia/golog)
A wrapper for the go log providing namespaces and standard levels
## Overview
The standard go log package provides the core writing methods but does
not provide any colouring or level functions. This simply provides those features.
You can overwrite the standard log on the package level if you require any
different settings.
## Installation
With a healthy Go Language installed, simply run `go get github.com/landonia/golog`
## Example
```go
package main
import (
"flag"
"github.com/landonia/golog/prettylog"
)
func main() {
log, err := prettylog.New(prettylog.WithNameSpace("mynamespace"))
if err != nil {
panic(err)
}
// Setup application.....
log.Info("Application has started successfully..")
// .. something goes wrong
log.Error("Whoops")
}
```
## Out of Box Example
simply run `go run $GOPATH/src/github.com/landonia/golog/cmd/example.go`
You should see output to the following:

## About
golog was written by [Landon Wainwright](http://www.landotube.com) | [GitHub](https://github.com/landonia).
Follow me on [Twitter @landotube](http://www.twitter.com/landotube)! Although I don't really tweet much tbh.