Adding rainbow

rc-0.2.0
Kris Nova 2018-11-27 14:51:36 -08:00
parent f6d6f945a8
commit eab6fbdae1
1 changed files with 41 additions and 1 deletions

View File

@ -2,7 +2,47 @@
Ported from it's [original location](https://github.com/kubicorn/kubicorn/tree/master/pkg/logger) in the Kubicorn code base.
Simple golang logger
# Rainbow logs
```go
package main
import (
"github.com/kris-nova/logger"
"fmt"
"os"
)
func main(){
logger.Fabulous = true
logger.Color = false
logger.Level = 4
err := fmt.Errorf("New error")
logger.Always("This is always printed")
logger.Success("Hooray a good thing happened!")
logger.Info("we found an error: %v", err)
logger.Debug("this is a useful message for software enigneers")
logger.Warning("something bad happened but the software can still run")
// Notice this does *NOT* exit!
logger.Critical("the software should stop running, this is bad")
// Now we have to exit
os.Exit(123)
}
```
# Simple golang logger
```go
package main