aboutsummaryrefslogtreecommitdiffstats
path: root/golang
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-09 19:07:25 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-09 19:07:25 -0700
commit12e2e04bcfb48e543d0fb2b8f45ae071363fe54e (patch)
treec5d802b3aa2bfebbfe7dd3b49216c4bb34867840 /golang
parent6fceb914a9479b7a6c19a0f54971b3bd580146df (diff)
downloadfatcat-12e2e04bcfb48e543d0fb2b8f45ae071363fe54e.tar.gz
fatcat-12e2e04bcfb48e543d0fb2b8f45ae071363fe54e.zip
logrus logging
Diffstat (limited to 'golang')
-rw-r--r--golang/Gopkg.lock23
-rw-r--r--golang/cmd/fatcatd/main.go11
-rw-r--r--golang/restapi/server.go2
3 files changed, 33 insertions, 3 deletions
diff --git a/golang/Gopkg.lock b/golang/Gopkg.lock
index 3e28a860..41e81cc2 100644
--- a/golang/Gopkg.lock
+++ b/golang/Gopkg.lock
@@ -117,6 +117,12 @@
revision = "00c29f56e2386353d58c599509e8dc3801b0d716"
[[projects]]
+ name = "github.com/sirupsen/logrus"
+ packages = ["."]
+ revision = "c155da19408a8799da419ed3eeb0cb5db0ad5dbc"
+ version = "v1.0.5"
+
+[[projects]]
name = "github.com/tylerb/graceful"
packages = ["."]
revision = "4654dfbb6ad53cb5e27f37d99b02e16c1872fbbb"
@@ -124,6 +130,12 @@
[[projects]]
branch = "master"
+ name = "golang.org/x/crypto"
+ packages = ["ssh/terminal"]
+ revision = "2d027ae1dddd4694d54f7a8b6cbe78dca8720226"
+
+[[projects]]
+ branch = "master"
name = "golang.org/x/net"
packages = [
"context",
@@ -132,6 +144,15 @@
revision = "f73e4c9ed3b7ebdd5f699a16a880c2b1994e50dd"
[[projects]]
+ branch = "master"
+ name = "golang.org/x/sys"
+ packages = [
+ "unix",
+ "windows"
+ ]
+ revision = "64746a42f36bf0832f86b76004f1699dbeb33e4f"
+
+[[projects]]
name = "golang.org/x/text"
packages = [
"collate",
@@ -171,6 +192,6 @@
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
- inputs-digest = "ca4394feb80a5db162405569df88f18596fe247fbe3817a854ecb54038e8550d"
+ inputs-digest = "909cd858ce9bdc12fadeebb01df7ee2b57ab78d03f1c6c0a1130fc56b3c9f445"
solver-name = "gps-cdcl"
solver-version = 1
diff --git a/golang/cmd/fatcatd/main.go b/golang/cmd/fatcatd/main.go
index 94455bf8..c0668ed1 100644
--- a/golang/cmd/fatcatd/main.go
+++ b/golang/cmd/fatcatd/main.go
@@ -2,9 +2,9 @@
package main
import (
- "log"
"os"
+ log "github.com/sirupsen/logrus"
loads "github.com/go-openapi/loads"
flags "github.com/jessevdk/go-flags"
@@ -12,8 +12,17 @@ import (
"git.archive.org/bnewbold/fatcat/golang/restapi/operations"
)
+func init() {
+
+ // not default of stderr
+ log.SetOutput(os.Stdout);
+
+}
+
func main() {
+ log.Warn("Starting up...");
+
// load embedded swagger file
swaggerSpec, err := loads.Analyzed(restapi.SwaggerJSON, "")
if err != nil {
diff --git a/golang/restapi/server.go b/golang/restapi/server.go
index 3335bc9e..a11c94c6 100644
--- a/golang/restapi/server.go
+++ b/golang/restapi/server.go
@@ -7,7 +7,6 @@ import (
"crypto/x509"
"errors"
"io/ioutil"
- "log"
"net"
"net/http"
"os"
@@ -16,6 +15,7 @@ import (
"sync/atomic"
"time"
+ log "github.com/sirupsen/logrus"
"github.com/go-openapi/runtime/flagext"
"github.com/go-openapi/swag"
flags "github.com/jessevdk/go-flags"