gc
github.com/motemen/go-colorine
go get github.com/motemen/go-colorine
gc

github.com/motemen/go-colorine

A simple colorized console logger

by Hironao OTSUBO

v0.0.0-20180816141035-45d19169413a (see all)License:MIT
go get github.com/motemen/go-colorine
Readme

colorine GoDoc Build Status

A simple colorized console logger for golang

Example

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

GitHub Stars

12

LAST COMMIT

4yrs ago

MAINTAINERS

0

CONTRIBUTORS

2

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
v0.0.0-20140531084116-49ff36b8fa42
2yrs ago
v0.0.0-20180816141035-45d19169413a
3yrs ago
No alternatives found
No tutorials found
Add a tutorial