Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/motemen/go-colorine
A simple colorized console logger
https://github.com/motemen/go-colorine
Last synced: 3 months ago
JSON representation
A simple colorized console logger
- Host: GitHub
- URL: https://github.com/motemen/go-colorine
- Owner: motemen
- License: mit
- Created: 2014-05-21T00:41:36.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-08-16T14:10:36.000Z (over 6 years ago)
- Last Synced: 2024-06-18T21:45:40.810Z (7 months ago)
- Language: Go
- Size: 87.9 KB
- Stars: 11
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
colorine [![GoDoc](https://godoc.org/github.com/motemen/go-colorine?status.png)](https://godoc.org/github.com/motemen/go-colorine) [![Build Status](https://api.travis-ci.org/motemen/go-colorine.svg?branch=master)](https://travis-ci.org/motemen/go-colorine)
========A simple colorized console logger for golang
Example
-------```go
import "github.com/motemen/go-colorine"logger := colorine.NewLogger(
colorine.Prefixes{
// Using colorine's predefined TextStyles
"create": colorine.Info,
"exist": colorine.Notice,
// Or specify your own
"debug": colorine.TextStyle{colorine.White, colorine.None},
"error": colorine.TextStyle{colorine.BrightRed, colorine.White},
},
// The default prefix color
colorine.TextStyle{colorine.Green, colorine.None},
)logger.Log("create", "path/to/file")
logger.Log("exist", "path/to/another/file")
logger.Log("error", "something went wrong!")
```Screenshot
----------![screenshot](screenshot.png)