add glide support

master
ehlxr 2017-06-25 18:36:42 +08:00
parent b67bf6d48b
commit 198c5ba16e
4 changed files with 21 additions and 46 deletions

1
.gitignore vendored
View File

@ -12,3 +12,4 @@
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
.glide/
vendor

16
glide.lock generated Normal file
View File

@ -0,0 +1,16 @@
hash: b4a7296ce90ac2076dfad3f71f09367dd2ab02fddd602a6520055363cd94f0d2
updated: 2017-06-25T18:28:49.820023852+08:00
imports:
- name: github.com/mattn/go-colorable
version: 941b50ebc6efddf4c41c8e4537a5f68a4e686b24
- name: github.com/mattn/go-isatty
version: fc9e8d8ef48496124e79ae0df75490096eccf6fe
- name: github.com/mgutz/ansi
version: 9520e82c474b0a04dd04f8a40959027271bab992
- name: github.com/sirupsen/logrus
version: 3d4380f53a34dcdc95f0c1db702615992b38d9a4
- name: github.com/x-cray/logrus-prefixed-formatter
version: 31b341217ca8d2c6958611c89032550fcd015df8
- name: golang.org/x/sys/unix
version: c23410a886927bab8ca5e80b08af6a56faeb330d
testImports: []

4
glide.yaml Normal file
View File

@ -0,0 +1,4 @@
package: github.com/ehlxr/go-utils
import:
- package: github.com/sirupsen/logrus
- package: github.com/x-cray/logrus-prefixed-formatter

View File

@ -1,46 +0,0 @@
package log
import (
"github.com/ehlxr/go-utils/log"
"github.com/sirupsen/logrus"
)
func init() {
log.SetLogLevel(logrus.DebugLevel)
// log.SetLogFormatter(&logrus.JSONFormatter{TimestampFormat: "2006-01-02 15:04:05"})
// log.SetFn(false)
}
func TestLog() {
log.Debug("debug text...")
log.Info("info text...")
log.Error("error text...")
// log.Fatal("fatal text...")
// log.Panic("panic text...")
log.DebugWithFields(log.Fields{
"id": "test",
"name": "jj",
}, "debug with fields text...")
log.InfoWithFields(log.Fields{
"id": "test",
"name": "jj",
}, "info with fields text...")
log.ErrorWithFields(log.Fields{
"id": "test",
"name": "jj",
}, "error with fields text...")
log.FatalWithFields(log.Fields{
"id": "test",
"name": "jj",
}, "fatal with fields text...")
// log.Panic(log.Fields{
// "id": "test",
// "name": "jj",
// }, "fatal with fields text...")
}