周玉环 d906a41c2e first commit 3 روز پیش
..
hooks d906a41c2e first commit 3 روز پیش
.gitignore d906a41c2e first commit 3 روز پیش
LICENSE d906a41c2e first commit 3 روز پیش
OWNERS d906a41c2e first commit 3 روز پیش
README.md d906a41c2e first commit 3 روز پیش
doc.go d906a41c2e first commit 3 روز پیش
formatter.go d906a41c2e first commit 3 روز پیش
log.go d906a41c2e first commit 3 روز پیش

README.md

log

Log package for go.

Nicely color-format-coded in development (when a TTY is attached, otherwise just plain text):

Colored

Example

package main

import (
  "errors"

  "yunion.io/x/log"
)

func main() {
  log.Debugf("Debug msg")
  log.Infof("Info msg")
  log.Warningf("Warning msg")
  err := errors.New("Unknown error")
  log.Errorf("Error msg: %v", err)
}