Skip to content

Commit c85c2ef

Browse files
committed
Merge pull request #9 from arschles/log
feat(log): add a log package
2 parents d172630 + e9e1986 commit c85c2ef

6 files changed

Lines changed: 298 additions & 45 deletions

File tree

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ VERSION := 0.0.1-$(shell date "+%Y%m%d%H%M%S")
1414
# Common flags passed into Go's linker.
1515
LDFLAGS := "-s -X main.version=${VERSION}"
1616

17+
NV_PKGS := $(shell glide nv)
18+
1719
all: build test
1820

1921
# This builds .a files, which will be placed in $GOPATH/pkg
2022
build:
21-
go build ./...
23+
go build ${NV_PKGS}
2224

2325
test:
24-
go test $(shell glide nv)
26+
go test ${NV_PKGS}
2527

2628

2729
.PHONY: all build test

glide.lock

Lines changed: 39 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
package: github.com/deis/pkg
2-
flatten: true
3-
import:
4-
- package: k8s.io/kubernetes
5-
version: ~1.1
6-
- package: github.com/Masterminds/cookoo
7-
version: ">=1.3.0"
8-
- package: github.com/coreos/etcd/client
9-
- package: golang.org/x/net/context
10-
- package: github.com/steveeJ/gexpect
11-
repo: https://github.com/coreos/gexpect
12-
- package: code.google.com/p/goprotobuf
13-
repo: https://github.com/golang/protobuf
14-
- package: launchpad.net/gocheck
15-
repo: https://github.com/go-check/check
162
ignore:
17-
- appengine
3+
- appengine
4+
import:
5+
- package: k8s.io/kubernetes
6+
version: ~1.1
7+
- package: github.com/Masterminds/cookoo
8+
version: '>=1.3.0'
9+
- package: github.com/coreos/etcd
10+
version: e4561dd8cfb1163fb51afceca9c78aa89398e731
11+
subpackages:
12+
- client
13+
- package: golang.org/x/net
14+
version: c2528b2dd8352441850638a8bb678c2ad056fd3e
15+
subpackages:
16+
- context
17+
- package: github.com/steveeJ/gexpect
18+
repo: https://github.com/coreos/gexpect
19+
- package: code.google.com/p/goprotobuf
20+
repo: https://github.com/golang/protobuf
21+
- package: launchpad.net/gocheck
22+
repo: https://github.com/go-check/check
23+
- package: github.com/arschles/assert

log/doc.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Package log provides functionality to output human readable, colorful test to STDOUT and STDERR. It's best used for programs, such as CLI apps, that write output to people rather than machines. It is not intended for logging to log aggregators or other systems. It takes advantage of the github.com/deis/pkg/prettyprint to provide colorful output.
2+
//
3+
// This package provides global functions for use as well as a 'Logger' struct that you can instantiate at-will for customized logging. All global funcs operate on a DefaultLogger, which is pre-configured to log to os.Stdout and os.Stderr, with debug logs turned off.
4+
//
5+
// Example usage of global functions:
6+
//
7+
// import "github.com/deis/pkg/log"
8+
// log.Info("Hello Gophers!") // equivalent of log.DefaultLogger.Info("hello gophers!")
9+
// log.Debug("log.DefaultLogger initializes with debug logs turned off, so you can't see me!")
10+
// log.DefaultLogger.SetDebug(true)
11+
// log.Debug("Now that we turned debug logs on, you can see me now!")
12+
//
13+
// Example usage of instantiating an individual logger:
14+
//
15+
// // create a new logger that sends all stderr logs to /dev/null, and turns on debug logs
16+
// logger := log.NewLogger(os.Stdout, iouitl.Discard, true)
17+
// log.Debug("Hello Gophers!")
18+
package log

0 commit comments

Comments
 (0)