diff --git a/.gitignore b/.gitignore
index 47d8c27..d20b1f9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,7 +6,6 @@
# Folders
_obj
_test
-build
artifacts
# Architecture specific extensions/prefixes
diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json
index b1d6bf9..fc0b228 100644
--- a/Godeps/Godeps.json
+++ b/Godeps/Godeps.json
@@ -36,13 +36,13 @@
},
{
"ImportPath": "github.com/docker/docker/builder/dockerfile/command",
- "Comment": "v1.4.1-10811-gc5aedcd",
- "Rev": "c5aedcdac9c30e764c22d1be1dd2c08c52c74fcc"
+ "Comment": "v1.4.1-10902-g8bbe3de",
+ "Rev": "8bbe3de4b3cd951719120e47b4f97653c11566f7"
},
{
"ImportPath": "github.com/docker/docker/builder/dockerfile/parser",
- "Comment": "v1.4.1-10811-gc5aedcd",
- "Rev": "c5aedcdac9c30e764c22d1be1dd2c08c52c74fcc"
+ "Comment": "v1.4.1-10902-g8bbe3de",
+ "Rev": "8bbe3de4b3cd951719120e47b4f97653c11566f7"
},
{
"ImportPath": "github.com/docker/go-units",
diff --git a/build/builder.go b/build/builder.go
index 2cee3df..4dd80a6 100644
--- a/build/builder.go
+++ b/build/builder.go
@@ -98,16 +98,16 @@ func NewBuilder(manifest *Manifest, conf *configuration.Config) *Builder {
// StartBuild runs the build process end to end
func (b *Builder) StartBuild() error {
- b.Conf.Logger.Debug("Building %d steps", len(b.Build.Steps))
+ b.Conf.Logger.Debugf("Building %d steps", len(b.Build.Steps))
for i, s := range b.Build.Steps {
- b.Conf.Logger.Debug("Step %d - %s: %s", i, s.Label, s.Name)
+ b.Conf.Logger.Debugf("Step %d - %s: %s", i, s.Label, s.Name)
}
for _, levels := range b.Build.buildLevels {
for _, s := range levels {
b.wg.Add(1)
go func(st Step) {
- b.Conf.Logger.Debug("Parallel build for %s", st.Name)
+ b.Conf.Logger.Debugf("Parallel build for %s", st.Name)
defer b.wg.Done()
err := b.BuildStep(&st)
@@ -131,7 +131,7 @@ func (b *Builder) StartBuild() error {
// Clear after yourself: images, containers, etc (optional for premium users)
// except last step
for _, s := range b.Build.Steps[:len(b.Build.Steps)-1] {
- b.Conf.Logger.Debug("Removing unwanted image %s", b.uniqueStepName(&s))
+ b.Conf.Logger.Debugf("Removing unwanted image %s", b.uniqueStepName(&s))
rmiOptions := docker.RemoveImageOptions{Force: b.Conf.FroceRmImages, NoPrune: b.Conf.NoPruneRmImages}
err := b.docker.RemoveImageExtended(b.uniqueStepName(&s), rmiOptions)
if err != nil {
@@ -162,7 +162,7 @@ func (b *Builder) uniqueStepName(step *Step) string {
// BuildStep builds a single step
func (b *Builder) BuildStep(step *Step) error {
- b.Conf.Logger.Notice("Building %s", step.Name)
+ b.Conf.Logger.Noticef("Building %s", step.Name)
// fix the Dockerfile
err := b.replaceFromField(step)
if err != nil {
@@ -174,7 +174,7 @@ func (b *Builder) BuildStep(step *Step) error {
buildArgs = append(buildArgs, docker.BuildArg{Name: s.Key, Value: s.Value})
}
// call Docker to build the Dockerfile (from the parsed file)
- b.Conf.Logger.Debug("Building the image from %s", filepath.Base(b.uniqueDockerfile(step)))
+ b.Conf.Logger.Debugf("Building the image from %s", filepath.Base(b.uniqueDockerfile(step)))
opts := docker.BuildImageOptions{
Name: b.uniqueStepName(step),
Dockerfile: filepath.Base(b.uniqueDockerfile(step)),
@@ -209,7 +209,7 @@ func (b *Builder) BuildStep(step *Step) error {
if !b.Conf.NoSquash && len(step.Cleanup.Commands) > 0 {
// start the container
- b.Conf.Logger.Notice("Starting container %s to run cleanup commands", container.ID)
+ b.Conf.Logger.Noticef("Starting container %s to run cleanup commands", container.ID)
startOpts := &docker.HostConfig{}
err := b.docker.StartContainer(container.ID, startOpts)
if err != nil {
@@ -217,7 +217,7 @@ func (b *Builder) BuildStep(step *Step) error {
}
for _, cmd := range step.Cleanup.Commands {
- b.Conf.Logger.Debug("Running cleanup command %s on %s", cmd, container.ID)
+ b.Conf.Logger.Debugf("Running cleanup command %s on %s", cmd, container.ID)
// create an exec for the commands
execOpts := docker.CreateExecOptions{
Container: container.ID,
@@ -242,7 +242,7 @@ func (b *Builder) BuildStep(step *Step) error {
}
if err := b.docker.StartExec(execObj.ID, startExecOpts); err != nil {
- b.Conf.Logger.Error("Failed to run cleanup commands %s", err.Error())
+ b.Conf.Logger.Errorf("Failed to run cleanup commands %s", err.Error())
}
success <- struct{}{}
}()
@@ -254,13 +254,13 @@ func (b *Builder) BuildStep(step *Step) error {
Container: container.ID,
}
- b.Conf.Logger.Debug("Commiting the container %s", container.ID)
+ b.Conf.Logger.Debugf("Commiting the container %s", container.ID)
img, err := b.docker.CommitContainer(cmtOpts)
if err != nil {
return err
}
- b.Conf.Logger.Debug("Stopping the container %s", container.ID)
+ b.Conf.Logger.Debugf("Stopping the container %s", container.ID)
err = b.docker.StopContainer(container.ID, 0)
if err != nil {
return err
@@ -282,7 +282,7 @@ func (b *Builder) BuildStep(step *Step) error {
OutputStream: tarWriter,
}
- b.Conf.Logger.Notice("Exporting cleaned up container %s to %s", img.ID, tmpFile.Name())
+ b.Conf.Logger.Noticef("Exporting cleaned up container %s to %s", img.ID, tmpFile.Name())
err = b.docker.ExportImage(expOpts)
if err != nil {
return err
@@ -294,7 +294,7 @@ func (b *Builder) BuildStep(step *Step) error {
return err
}
defer sqTmpFile.Close()
- b.Conf.Logger.Notice("Squashing image %s into %s", sqTmpFile.Name(), img.ID)
+ b.Conf.Logger.Noticef("Squashing image %s into %s", sqTmpFile.Name(), img.ID)
squasher := squash.Squasher{Conf: b.Conf}
err = squasher.Squash(tmpFile.Name(), sqTmpFile.Name(), b.uniqueStepName(step))
@@ -302,7 +302,7 @@ func (b *Builder) BuildStep(step *Step) error {
return err
}
- b.Conf.Logger.Debug("Removing exported temp files")
+ b.Conf.Logger.Debugf("Removing exported temp files")
err = os.Remove(tmpFile.Name())
if err != nil {
return err
@@ -317,7 +317,7 @@ func (b *Builder) BuildStep(step *Step) error {
loadOps := docker.LoadImageOptions{
InputStream: sqashedFile,
}
- b.Conf.Logger.Debug("Loading squashed image into docker")
+ b.Conf.Logger.Debugf("Loading squashed image into docker")
err = b.docker.LoadImage(loadOps)
if err != nil {
return err
@@ -330,7 +330,7 @@ func (b *Builder) BuildStep(step *Step) error {
}
if len(step.Artefacts) > 0 {
- b.Conf.Logger.Notice("Starting container %s to fetch artefact permissions", container.ID)
+ b.Conf.Logger.Noticef("Starting container %s to fetch artefact permissions", container.ID)
startOpts := &docker.HostConfig{}
err := b.docker.StartContainer(container.ID, startOpts)
if err != nil {
@@ -362,25 +362,25 @@ func (b *Builder) BuildStep(step *Step) error {
}
if err := b.docker.StartExec(execObj.ID, startExecOpts); err != nil {
- b.Conf.Logger.Error("Failed to fetch artefact permissions for %s: %s", art.Source, err.Error())
+ b.Conf.Logger.Errorf("Failed to fetch artefact permissions for %s: %s", art.Source, err.Error())
}
permsString := strings.Replace(strings.Replace(buf.String(), "'", "", -1), "\n", "", -1)
perms, err := strconv.Atoi(permsString)
if err != nil {
- b.Conf.Logger.Error("Failed to fetch artefact permissions for %s: %s", art.Source, err.Error())
+ b.Conf.Logger.Errorf("Failed to fetch artefact permissions for %s: %s", art.Source, err.Error())
}
permMap[art.Source] = perms
- b.Conf.Logger.Debug("Permissions for %s is %d", art.Source, perms)
+ b.Conf.Logger.Debugf("Permissions for %s is %d", art.Source, perms)
}
- b.Conf.Logger.Debug("Stopping the container %s", container.ID)
+ b.Conf.Logger.Debugf("Stopping the container %s", container.ID)
err = b.docker.StopContainer(container.ID, 0)
if err != nil {
return err
}
- b.Conf.Logger.Notice("Copying artefacts from %s", container.ID)
+ b.Conf.Logger.Noticef("Copying artefacts from %s", container.ID)
for _, art := range step.Artefacts {
err = b.copyToHost(&art, container.ID, permMap)
@@ -392,7 +392,7 @@ func (b *Builder) BuildStep(step *Step) error {
// any commands to run?
if step.Command != "" {
- b.Conf.Logger.Notice("Starting container %s to run commands", container.ID)
+ b.Conf.Logger.Noticef("Starting container %s to run commands", container.ID)
startOpts := &docker.HostConfig{}
err := b.docker.StartContainer(container.ID, startOpts)
@@ -421,13 +421,13 @@ func (b *Builder) BuildStep(step *Step) error {
Detach: false,
}
- b.Conf.Logger.Notice("Running command %s on container %s", execOpts.Cmd, container.ID)
+ b.Conf.Logger.Noticef("Running command %s on container %s", execOpts.Cmd, container.ID)
if err := b.docker.StartExec(execObj.ID, startExecOpts); err != nil {
- b.Conf.Logger.Error("Failed to execute command '%s' due to %s", step.Command, err.Error())
+ b.Conf.Logger.Errorf("Failed to execute command '%s' due to %s", step.Command, err.Error())
}
- b.Conf.Logger.Notice("\n%s", buf)
+ b.Conf.Logger.Noticef("\n%s", buf)
inspect, err := b.docker.InspectExec(execObj.ID)
if err != nil {
@@ -435,13 +435,13 @@ func (b *Builder) BuildStep(step *Step) error {
}
if inspect.ExitCode != 0 {
- b.Conf.Logger.Error("Running command %s on container %s exit with exit code %d", execOpts.Cmd, container.ID, inspect.ExitCode)
+ b.Conf.Logger.Errorf("Running command %s on container %s exit with exit code %d", execOpts.Cmd, container.ID, inspect.ExitCode)
return err
} else {
- b.Conf.Logger.Notice("Running command %s on container %s exit with exit code %d", execOpts.Cmd, container.ID, inspect.ExitCode)
+ b.Conf.Logger.Noticef("Running command %s on container %s exit with exit code %d", execOpts.Cmd, container.ID, inspect.ExitCode)
}
- b.Conf.Logger.Debug("Stopping the container %s", container.ID)
+ b.Conf.Logger.Debugf("Stopping the container %s", container.ID)
err = b.docker.StopContainer(container.ID, 0)
if err != nil {
return err
@@ -455,7 +455,7 @@ func (b *Builder) BuildStep(step *Step) error {
Force: true,
}
- b.Conf.Logger.Debug("Removing built container %s", container.ID)
+ b.Conf.Logger.Debugf("Removing built container %s", container.ID)
err = b.docker.RemoveContainer(removeOpts)
if err != nil {
return err
@@ -474,7 +474,7 @@ func (b *Builder) BuildStep(step *Step) error {
// this replaces the FROM field in the Dockerfile to one with the previous step's unique name
// it stores the parsed result Dockefile in uniqueSessionName file
func (b *Builder) replaceFromField(step *Step) error {
- b.Conf.Logger.Notice("Parsing and converting '%s'", step.Dockerfile)
+ b.Conf.Logger.Noticef("Parsing and converting '%s'", step.Dockerfile)
rwc, err := os.Open(path.Join(b.Conf.Workdir, step.Dockerfile))
if err != nil {
@@ -507,7 +507,7 @@ func (b *Builder) replaceFromField(step *Step) error {
}
// did it have any effect?
- b.Conf.Logger.Debug("Writing the new Dockerfile into %s", step.Dockerfile+".generated")
+ b.Conf.Logger.Debugf("Writing the new Dockerfile into %s", step.Dockerfile+".generated")
err = ioutil.WriteFile(b.uniqueDockerfile(step), []byte(dumpDockerfile(node)), 0644)
if err != nil {
return err
@@ -561,7 +561,7 @@ func (b *Builder) copyToHost(a *Artefact, container string, perms map[string]int
switch hdr.Typeflag {
case tar.TypeReg:
- b.Conf.Logger.Info("Copying from %s to %s", a.Source, destFile)
+ b.Conf.Logger.Infof("Copying from %s to %s", a.Source, destFile)
dest, err := os.Create(destFile)
if err != nil {
@@ -577,7 +577,7 @@ func (b *Builder) copyToHost(a *Artefact, container string, perms map[string]int
}
}
- b.Conf.Logger.Debug("Setting file permissions for %s to %d", destFile, perms[a.Source])
+ b.Conf.Logger.Debugf("Setting file permissions for %s to %d", destFile, perms[a.Source])
err = os.Chmod(destFile, os.FileMode(perms[a.Source])|0700)
if err != nil {
return err
diff --git a/build/manifest.go b/build/manifest.go
index f212ab1..2fe658d 100644
--- a/build/manifest.go
+++ b/build/manifest.go
@@ -95,7 +95,7 @@ type namespace struct {
// LoadBuildFromFile loads Build from a yaml file
func LoadBuildFromFile(config *configuration.Config) (*Manifest, error) {
- config.Logger.Notice("Using '%s' as build file", config.Buildfile)
+ config.Logger.Noticef("Using '%s' as build file", config.Buildfile)
n := namespace{Config: config}
diff --git a/main.go b/main.go
index 0b5b2b9..04b9062 100644
--- a/main.go
+++ b/main.go
@@ -17,7 +17,7 @@ var prettyFormat = logging.MustStringFormatter(
"%{color}▶ %{message} %{color:reset}",
)
var plainFormat = logging.MustStringFormatter(
- "[%{level:-8s}] - %{message}",
+ "[%{level}] - %{message}",
)
var (
diff --git a/server.go b/server.go
index eefb518..32fb0d9 100644
--- a/server.go
+++ b/server.go
@@ -32,11 +32,11 @@ func (s *server) StartServer() error {
api.SetApp(router)
go func() {
- s.builder.Conf.Logger.Info("Starting API on %d", s.builder.Conf.ApiPort)
+ s.builder.Conf.Logger.Infof("Starting API on %d", s.builder.Conf.ApiPort)
// 192.168.99.1
if err := http.ListenAndServe(fmt.Sprintf("%s:%d", s.builder.Conf.ApiBinding, s.builder.Conf.ApiPort), api.MakeHandler()); err != nil {
- s.builder.Conf.Logger.Error("Failed to start API %s", err.Error())
+ s.builder.Conf.Logger.Errorf("Failed to start API %s", err.Error())
os.Exit(2)
}
diff --git a/squash/export.go b/squash/export.go
index 9f531fa..6fc1586 100644
--- a/squash/export.go
+++ b/squash/export.go
@@ -141,9 +141,9 @@ func LoadExport(conf *configuration.Config, image, location string) (*Export, er
}
if image == "" {
- conf.Logger.Debug("Loading export from STDIN using %s for tempdir", location)
+ conf.Logger.Debugf("Loading export from STDIN using %s for tempdir", location)
} else {
- conf.Logger.Debug("Loading export from %s using %s for tempdir", image, location)
+ conf.Logger.Debugf("Loading export from %s using %s for tempdir", image, location)
}
ir := os.Stdin
@@ -192,9 +192,9 @@ func LoadExport(conf *configuration.Config, image, location string) (*Export, er
return nil, err
}
- conf.Logger.Debug("Loaded image w/ %s layers", strconv.FormatInt(int64(len(export.Entries)), 10))
+ conf.Logger.Debugf("Loaded image w/ %s layers", strconv.FormatInt(int64(len(export.Entries)), 10))
for repo, tags := range export.Repositories {
- conf.Logger.Debug(" - %s (%s tags)", repo, strconv.FormatInt(int64(len(*tags)), 10))
+ conf.Logger.Debugf(" - %s (%s tags)", repo, strconv.FormatInt(int64(len(*tags)), 10))
}
return export, err
}
@@ -252,7 +252,7 @@ func (e *Export) ExtractLayers() error {
e.conf.Logger.Debug("Extracting layers...")
for _, entry := range e.Entries {
- e.conf.Logger.Debug(" - %s", entry.LayerTarPath)
+ e.conf.Logger.Debugf(" - %s", entry.LayerTarPath)
err := entry.ExtractLayerDir()
if err != nil {
return err
@@ -355,7 +355,7 @@ func (e *Export) PrintHistory() {
cmd = cmd[0:57] + "..."
}
- e.conf.Logger.Debug(" - %s %s %s %s", order[i].LayerConfig.Id[0:12],
+ e.conf.Logger.Debugf(" - %s %s %s %s", order[i].LayerConfig.Id[0:12],
humanDuration(time.Now().UTC().Sub(order[i].LayerConfig.Created.UTC())),
cmd, units.HumanSize(float64(size)))
}
@@ -422,7 +422,7 @@ func (e *Export) ReplaceLayer(oldId string) (*ExportedImage, error) {
cmd = cmd[:47] + "..."
}
- e.conf.Logger.Debug(" - Replacing %s w/ new layer %s (%s)", oldId[:12], id[:12], cmd)
+ e.conf.Logger.Debugf(" - Replacing %s w/ new layer %s (%s)", oldId[:12], id[:12], cmd)
if child != nil {
child.LayerConfig.Parent = id
err = child.WriteJson()
@@ -474,7 +474,7 @@ func (e *Export) ReplaceLayer(oldId string) (*ExportedImage, error) {
func (e *Export) SquashLayers(to, from *ExportedImage) error {
- e.conf.Logger.Debug("Squashing from %s into %s", from.LayerConfig.Id[:12], to.LayerConfig.Id[:12])
+ e.conf.Logger.Debugf("Squashing from %s into %s", from.LayerConfig.Id[:12], to.LayerConfig.Id[:12])
layerDir := filepath.Join(to.Path, "layer")
err := os.MkdirAll(layerDir, 0755)
if err != nil {
@@ -601,7 +601,7 @@ func (e *Export) rewriteChildren(entry *ExportedImage) error {
entry = e.ChildOf(newEntry.LayerConfig.Id)
} else {
- e.conf.Logger.Debug(" - Removing %s. Squashed. (%s)", entry.LayerConfig.Id[:12], cmd)
+ e.conf.Logger.Debugf(" - Removing %s. Squashed. (%s)", entry.LayerConfig.Id[:12], cmd)
err := os.RemoveAll(entry.Path)
if err != nil {
return err
diff --git a/squash/squasher.go b/squash/squasher.go
index bc9c956..78e0c51 100644
--- a/squash/squasher.go
+++ b/squash/squasher.go
@@ -26,7 +26,7 @@ type Squasher struct {
func (s *Squasher) shutdown(tempdir string) {
defer wg.Done()
<-signals
- s.Conf.Logger.Debug("Removing tempdir %s", tempdir)
+ s.Conf.Logger.Debugf("Removing tempdir %s", tempdir)
err := os.RemoveAll(tempdir)
if err != nil {
s.Conf.Logger.Fatal(err.Error())
@@ -114,7 +114,7 @@ func (s *Squasher) Squash(input string, output string, tag string) error {
return err
}
- s.Conf.Logger.Debug("Inserted new layer %s after %s", newEntry.LayerConfig.Id[0:12],
+ s.Conf.Logger.Debugf("Inserted new layer %s after %s", newEntry.LayerConfig.Id[0:12],
newEntry.LayerConfig.Parent[0:12])
e := export.Root()
@@ -128,9 +128,9 @@ func (s *Squasher) Squash(input string, output string, tag string) error {
}
if e.LayerConfig.Id == newEntry.LayerConfig.Id {
- s.Conf.Logger.Debug(" -> %s %s", e.LayerConfig.Id[0:12], cmd)
+ s.Conf.Logger.Debugf(" -> %s %s", e.LayerConfig.Id[0:12], cmd)
} else {
- s.Conf.Logger.Debug(" - %s %s", e.LayerConfig.Id[0:12], cmd)
+ s.Conf.Logger.Debugf(" - %s %s", e.LayerConfig.Id[0:12], cmd)
}
e = export.ChildOf(e.LayerConfig.Id)
}
@@ -141,7 +141,7 @@ func (s *Squasher) Squash(input string, output string, tag string) error {
return err
}
- s.Conf.Logger.Debug("Tarring up squashed layer %s", newEntry.LayerConfig.Id[:12])
+ s.Conf.Logger.Debugf("Tarring up squashed layer %s", newEntry.LayerConfig.Id[:12])
// create a layer.tar from our squashed layer
err = newEntry.TarLayer()
if err != nil {
@@ -169,7 +169,7 @@ func (s *Squasher) Squash(input string, output string, tag string) error {
tagInfo[tagPart] = layer.LayerConfig.Id
export.Repositories[repoPart] = &tagInfo
- s.Conf.Logger.Debug("Tagging %s as %s:%s", layer.LayerConfig.Id[0:12], repoPart, tagPart)
+ s.Conf.Logger.Debugf("Tagging %s as %s:%s", layer.LayerConfig.Id[0:12], repoPart, tagPart)
err := export.WriteRepositoriesJson()
if err != nil {
return err
@@ -183,9 +183,9 @@ func (s *Squasher) Squash(input string, output string, tag string) error {
if err != nil {
return err
}
- s.Conf.Logger.Debug("Tarring new image to %s", output)
+ s.Conf.Logger.Debugf("Tarring new image to %s", output)
} else {
- s.Conf.Logger.Debug("Tarring new image to STDOUT")
+ s.Conf.Logger.Debugf("Tarring new image to STDOUT")
}
// bundle up the new image
err = export.TarLayers(ow)
diff --git a/vendor/github.com/bugsnag/bugsnag-go/.travis.yml b/vendor/github.com/bugsnag/bugsnag-go/.travis.yml
index ddf3c13..0d56765 100644
--- a/vendor/github.com/bugsnag/bugsnag-go/.travis.yml
+++ b/vendor/github.com/bugsnag/bugsnag-go/.travis.yml
@@ -1,13 +1,11 @@
+sudo: false
language: go
go:
- 1.3
- 1.4
+ - 1.5
- tip
-install:
- - go get github.com/bugsnag/panicwrap
- - go get github.com/bugsnag/osext
- - go get github.com/bitly/go-simplejson
- - go get github.com/revel/revel
- - go get github.com/juju/loggo
+script:
+ - make ci
diff --git a/vendor/github.com/bugsnag/bugsnag-go/Makefile b/vendor/github.com/bugsnag/bugsnag-go/Makefile
index fbe61b6..70ec732 100644
--- a/vendor/github.com/bugsnag/bugsnag-go/Makefile
+++ b/vendor/github.com/bugsnag/bugsnag-go/Makefile
@@ -1,2 +1,30 @@
-default:
+TEST?=./...
+
+default: alldeps test
+
+deps:
+ go get -v -d ./...
+
+alldeps:
+ go get -v -d -t ./...
+
+updatedeps:
+ go get -v -d -u ./...
+
+test: alldeps
go test
+ @go vet 2>/dev/null ; if [ $$? -eq 3 ]; then \
+ go get golang.org/x/tools/cmd/vet; \
+ fi
+ @go vet $(TEST) ; if [ $$? -eq 1 ]; then \
+ echo "go-vet: Issues running go vet ./..."; \
+ exit 1; \
+ fi
+
+ci: alldeps test
+
+bench:
+ go test --bench=.*
+
+
+.PHONY: bin checkversion ci default deps generate releasebin test testacc testrace updatedeps
diff --git a/vendor/github.com/bugsnag/bugsnag-go/README.md b/vendor/github.com/bugsnag/bugsnag-go/README.md
index 06e97e4..60ddc99 100644
--- a/vendor/github.com/bugsnag/bugsnag-go/README.md
+++ b/vendor/github.com/bugsnag/bugsnag-go/README.md
@@ -1,5 +1,7 @@
-Bugsnag Notifier for Golang
-===========================
+# Bugsnag Notifier for Golang
+[![Latest Version](http://img.shields.io/github/release/bugsnag/bugsnag-go.svg?style=flat-square)](https://github.com/bugsnag/bugsnag-go/releases)
+[![Build Status](https://travis-ci.org/bugsnag/bugsnag-go.svg)](https://travis-ci.org/bugsnag/bugsnag-go)
+[![Go Documentation](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/bugsnag/bugsnag-go)
The Bugsnag Notifier for Golang gives you instant notification of panics, or
unexpected errors, in your golang app. Any unhandled panics will trigger a
@@ -362,6 +364,8 @@ In order to determine where a crash happens Bugsnag needs to know which packages
be part of your app (as opposed to a library). By default this is set to `[]string{"main*"}`. Strings
are matched to package names using [`filepath.Match`](http://godoc.org/path/filepath#Match).
+For matching subpackages within a package you may use the `**` notation. For example, `github.com/domain/package/**` will match all subpackages under `package/`.
+
```go
bugsnag.Configure(bugsnag.Configuration{
ProjectPackages: []string{"main", "github.com/domain/myapp/*"},
diff --git a/vendor/github.com/bugsnag/bugsnag-go/configuration.go b/vendor/github.com/bugsnag/bugsnag-go/configuration.go
index 962f4bc..ad1d42d 100644
--- a/vendor/github.com/bugsnag/bugsnag-go/configuration.go
+++ b/vendor/github.com/bugsnag/bugsnag-go/configuration.go
@@ -118,6 +118,12 @@ func (config *Configuration) clone() *Configuration {
func (config *Configuration) isProjectPackage(pkg string) bool {
for _, p := range config.ProjectPackages {
+ if d, f := filepath.Split(p); f == "**" {
+ if strings.HasPrefix(pkg, d) {
+ return true
+ }
+ }
+
if match, _ := filepath.Match(p, pkg); match {
return true
}
@@ -129,6 +135,8 @@ func (config *Configuration) stripProjectPackages(file string) string {
for _, p := range config.ProjectPackages {
if len(p) > 2 && p[len(p)-2] == '/' && p[len(p)-1] == '*' {
p = p[:len(p)-1]
+ } else if p[len(p)-1] == '*' && p[len(p)-2] == '*' {
+ p = p[:len(p)-2]
} else {
p = p + "/"
}
@@ -140,7 +148,7 @@ func (config *Configuration) stripProjectPackages(file string) string {
return file
}
-func (config *Configuration) log(fmt string, args ...interface{}) {
+func (config *Configuration) logf(fmt string, args ...interface{}) {
if config != nil && config.Logger != nil {
config.Logger.Printf(fmt, args...)
} else {
diff --git a/vendor/github.com/bugsnag/bugsnag-go/examples/appengine/README.md b/vendor/github.com/bugsnag/bugsnag-go/examples/appengine/README.md
deleted file mode 100644
index 1ac4914..0000000
--- a/vendor/github.com/bugsnag/bugsnag-go/examples/appengine/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-This is an example google app-engine app.
-
-To use it you will need to install the [App Engine
-SDK](https://cloud.google.com/appengine/downloads) for Go.
-
-Then run:
-
- goapp deploy
-
-Then open: https://bugsnag-test.appspot.com/ in your web-browser.
diff --git a/vendor/github.com/bugsnag/bugsnag-go/examples/appengine/app.yaml b/vendor/github.com/bugsnag/bugsnag-go/examples/appengine/app.yaml
deleted file mode 100644
index 2fdff7b..0000000
--- a/vendor/github.com/bugsnag/bugsnag-go/examples/appengine/app.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-application: bugsnag-test
-version: 1
-runtime: go
-api_version: go1
-
-handlers:
-- url: /.*
- script: _go_app
diff --git a/vendor/github.com/bugsnag/bugsnag-go/examples/appengine/hello.go b/vendor/github.com/bugsnag/bugsnag-go/examples/appengine/hello.go
deleted file mode 100644
index 4e7e1e8..0000000
--- a/vendor/github.com/bugsnag/bugsnag-go/examples/appengine/hello.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package mellow
-
-import (
- "fmt"
- "github.com/bugsnag/bugsnag-go"
- "github.com/bugsnag/bugsnag-go/errors"
- "net/http"
- "os"
-)
-
-func init() {
- bugsnag.OnBeforeNotify(func(event *bugsnag.Event, config *bugsnag.Configuration) error {
- event.MetaData.AddStruct("original", event.Error.StackFrames())
- return nil
- })
- bugsnag.Configure(bugsnag.Configuration{
- APIKey: "066f5ad3590596f9aa8d601ea89af845",
- })
-
- http.HandleFunc("/", bugsnag.HandlerFunc(handler))
-}
-
-func handler(w http.ResponseWriter, r *http.Request) {
- fmt.Fprint(w, "welcome")
- notifier := bugsnag.New(r)
- notifier.Notify(fmt.Errorf("oh hia"), bugsnag.MetaData{"env": {"values": os.Environ()}})
- fmt.Fprint(w, "welcome\n")
-
- panic("zoomg")
-
- fmt.Fprintf(w, "%#v", errors.Errorf("oahi").StackFrames())
-}
diff --git a/vendor/github.com/bugsnag/bugsnag-go/examples/appengine/mylogs.txt b/vendor/github.com/bugsnag/bugsnag-go/examples/appengine/mylogs.txt
deleted file mode 100644
index a9c57d5..0000000
--- a/vendor/github.com/bugsnag/bugsnag-go/examples/appengine/mylogs.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-2601:9:8480:11d2:7909:b2e5:3722:ef57 - - [08/Jul/2014:01:16:25 -0700] "GET / HTTP/1.1" 500 0 - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"
-2601:9:8480:11d2:7909:b2e5:3722:ef57 - - [08/Jul/2014:01:16:25 -0700] "GET /favicon.ico HTTP/1.1" 500 0 - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"
-2601:9:8480:11d2:7909:b2e5:3722:ef57 - - [08/Jul/2014:01:18:20 -0700] "GET / HTTP/1.1" 500 0 - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"
-2601:9:8480:11d2:7909:b2e5:3722:ef57 - - [08/Jul/2014:01:18:20 -0700] "GET /favicon.ico HTTP/1.1" 500 0 - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"
diff --git a/vendor/github.com/bugsnag/bugsnag-go/examples/http/main.go b/vendor/github.com/bugsnag/bugsnag-go/examples/http/main.go
deleted file mode 100644
index d32a76a..0000000
--- a/vendor/github.com/bugsnag/bugsnag-go/examples/http/main.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package main
-
-import (
- "github.com/bugsnag/bugsnag-go"
- "log"
- "net/http"
-)
-
-func main() {
-
- http.HandleFunc("/", Get)
-
- bugsnag.Configure(bugsnag.Configuration{
- APIKey: "066f5ad3590596f9aa8d601ea89af845",
- })
-
- log.Println("Serving on 9001")
- http.ListenAndServe(":9001", bugsnag.Handler(nil))
-}
-
-func Get(w http.ResponseWriter, r *http.Request) {
- w.WriteHeader(200)
- w.Write([]byte("OK\n"))
-
- var a struct{}
- crash(a)
-}
-
-func crash(a interface{}) string {
- return a.(string)
-}
diff --git a/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/.gitignore b/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/.gitignore
deleted file mode 100644
index dae67d0..0000000
--- a/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-test-results/
-tmp/
-routes/
diff --git a/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/app/controllers/app.go b/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/app/controllers/app.go
deleted file mode 100644
index 6cf8480..0000000
--- a/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/app/controllers/app.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package controllers
-
-import "github.com/revel/revel"
-import "time"
-
-type App struct {
- *revel.Controller
-}
-
-func (c App) Index() revel.Result {
- go func() {
- time.Sleep(5 * time.Second)
- panic("hello!")
- }()
-
- s := make([]string, 0)
- revel.INFO.Print(s[0])
- return c.Render()
-}
diff --git a/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/app/init.go b/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/app/init.go
deleted file mode 100644
index f9a9f09..0000000
--- a/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/app/init.go
+++ /dev/null
@@ -1,40 +0,0 @@
-package app
-
-import "github.com/revel/revel"
-import "github.com/bugsnag/bugsnag-go/revel"
-
-func init() {
- // Filters is the default set of global filters.
- revel.Filters = []revel.Filter{
- revel.PanicFilter, // Recover from panics and display an error page instead.
- bugsnagrevel.Filter, // Send panics to Bugsnag
- revel.RouterFilter, // Use the routing table to select the right Action
- revel.FilterConfiguringFilter, // A hook for adding or removing per-Action filters.
- revel.ParamsFilter, // Parse parameters into Controller.Params.
- revel.SessionFilter, // Restore and write the session cookie.
- revel.FlashFilter, // Restore and write the flash cookie.
- revel.ValidationFilter, // Restore kept validation errors and save new ones from cookie.
- revel.I18nFilter, // Resolve the requested language
- HeaderFilter, // Add some security based headers
- revel.InterceptorFilter, // Run interceptors around the action.
- revel.CompressFilter, // Compress the result.
- revel.ActionInvoker, // Invoke the action.
- }
-
- // register startup functions with OnAppStart
- // ( order dependent )
- // revel.OnAppStart(InitDB())
- // revel.OnAppStart(FillCache())
-}
-
-// TODO turn this into revel.HeaderFilter
-// should probably also have a filter for CSRF
-// not sure if it can go in the same filter or not
-var HeaderFilter = func(c *revel.Controller, fc []revel.Filter) {
- // Add some common security headers
- c.Response.Out.Header().Add("X-Frame-Options", "SAMEORIGIN")
- c.Response.Out.Header().Add("X-XSS-Protection", "1; mode=block")
- c.Response.Out.Header().Add("X-Content-Type-Options", "nosniff")
-
- fc[0](c, fc[1:]) // Execute the next filter stage.
-}
diff --git a/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/app/views/App/Index.html b/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/app/views/App/Index.html
deleted file mode 100644
index deb2304..0000000
--- a/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/app/views/App/Index.html
+++ /dev/null
@@ -1,23 +0,0 @@
-{{set . "title" "Home"}}
-{{template "header.html" .}}
-
-It works!
-
-
- {{.Description}} -
- {{end}} -{{end}} - - diff --git a/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/app/views/errors/500.html b/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/app/views/errors/500.html deleted file mode 100644 index 0cef4de..0000000 --- a/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/app/views/errors/500.html +++ /dev/null @@ -1,16 +0,0 @@ - - - -- This exception has been logged. -
- {{end}} - - diff --git a/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/app/views/flash.html b/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/app/views/flash.html deleted file mode 100644 index 9c9ade9..0000000 --- a/vendor/github.com/bugsnag/bugsnag-go/examples/revelapp/app/views/flash.html +++ /dev/null @@ -1,18 +0,0 @@ -{{if .flash.success}} -