refactor(server): Replace log calls with logrus
This introduces a structured logging library that can be used (next step) to attach additional metadata to log entries.
This commit is contained in:
parent
d9b329ef59
commit
f4bf3518f6
8 changed files with 17 additions and 7 deletions
|
@ -10,11 +10,11 @@ package builder
|
|||
import (
|
||||
"archive/tar"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/google/nixery/layers"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// Create a new tarball from each of the paths in the list and write the tarball
|
||||
|
|
|
@ -26,7 +26,6 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
|
@ -38,6 +37,7 @@ import (
|
|||
"github.com/google/nixery/config"
|
||||
"github.com/google/nixery/layers"
|
||||
"github.com/google/nixery/manifest"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"golang.org/x/oauth2/google"
|
||||
)
|
||||
|
||||
|
|
|
@ -19,11 +19,11 @@ import (
|
|||
"encoding/json"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
"github.com/google/nixery/manifest"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// LocalCache implements the structure used for local caching of
|
||||
|
|
|
@ -19,10 +19,10 @@ package config
|
|||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"cloud.google.com/go/storage"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// Load (optional) GCS bucket signing data from the GCS_SIGNING_KEY and
|
||||
|
|
|
@ -17,10 +17,11 @@ import (
|
|||
"crypto/sha1"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// PkgSource represents the source from which the Nix package set used
|
||||
|
|
|
@ -117,4 +117,13 @@
|
|||
sha256 = "1b7q6haabnp53igpmvr6a2414yralhbrldixx4kbxxg1apy8jdjg";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/sirupsen/logrus";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/sirupsen/logrus";
|
||||
rev = "de736cf91b921d56253b4010270681d33fdf7cb5";
|
||||
sha256 = "1qixss8m5xy7pzbf0qz2k3shjw0asklm9sj6zyczp7mryrari0aj";
|
||||
};
|
||||
}
|
||||
]
|
||||
|
|
|
@ -105,11 +105,11 @@ package layers
|
|||
import (
|
||||
"crypto/sha1"
|
||||
"fmt"
|
||||
"log"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"gonum.org/v1/gonum/graph/flow"
|
||||
"gonum.org/v1/gonum/graph/simple"
|
||||
)
|
||||
|
|
|
@ -30,7 +30,6 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"time"
|
||||
|
@ -39,6 +38,7 @@ import (
|
|||
"github.com/google/nixery/builder"
|
||||
"github.com/google/nixery/config"
|
||||
"github.com/google/nixery/layers"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// ManifestMediaType is the Content-Type used for the manifest itself. This
|
||||
|
|
Loading…
Reference in a new issue