Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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)