Permalink
Browse files

Use log.std and just optionally attach syslog to it.

  • Loading branch information...
1 parent f731c3d commit a404ea27a8e08f50905bbcb1db6c02d970b49027 @dustin dustin committed Oct 15, 2012
Showing with 19 additions and 12 deletions.
  1. +1 −0 blobs.go
  2. +1 −0 database.go
  3. +1 −0 dns.go
  4. +1 −0 files.go
  5. +1 −1 frames.go
  6. +1 −0 fsck.go
  7. +1 −0 hash.go
  8. +1 −0 heartbeat.go
  9. +1 −0 http.go
  10. +1 −0 http_api.go
  11. +1 −0 list.go
  12. +3 −11 logging.go
  13. +1 −0 main.go
  14. +1 −0 nodes.go
  15. +1 −0 tar.go
  16. +1 −0 tasks.go
  17. +1 −0 zip.go
View
@@ -6,6 +6,7 @@ import (
"flag"
"io"
"io/ioutil"
+ "log"
"net/http"
"os"
"sort"
View
@@ -1,6 +1,7 @@
package main
import (
+ "log"
"net/http"
// Alias this because we call our connection couchbase
View
1 dns.go
@@ -2,6 +2,7 @@ package main
import (
"flag"
+ "log"
"net"
"strconv"
"strings"
View
@@ -5,6 +5,7 @@ import (
"flag"
"fmt"
"io"
+ "log"
"os"
"path/filepath"
"strings"
View
@@ -3,6 +3,7 @@ package main
import (
"errors"
"flag"
+ "log"
"net"
"net/http"
"sync"
@@ -133,7 +134,6 @@ func connectNewFramesClient(addr string) *frameClient {
frt := &framesweb.FramesRoundTripper{
Dialer: conn,
Timeout: time.Second * 5,
- Logger: log,
}
hc := &http.Client{Transport: frt}
frameClientsLock.Lock()
View
@@ -2,6 +2,7 @@ package main
import (
"encoding/json"
+ "log"
"net/http"
)
View
@@ -10,6 +10,7 @@ import (
"hash"
"io"
"io/ioutil"
+ "log"
"os"
"path/filepath"
"strings"
View
@@ -3,6 +3,7 @@ package main
import (
"errors"
"fmt"
+ "log"
"net"
"net/url"
"strings"
View
@@ -6,6 +6,7 @@ import (
"fmt"
"io"
"io/ioutil"
+ "log"
"math/rand"
"net/http"
"os"
View
@@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"io"
+ "log"
"math/rand"
"net/http"
"net/url"
View
@@ -2,6 +2,7 @@ package main
import (
"encoding/json"
+ "log"
"strings"
)
View
@@ -3,24 +3,16 @@
package main
import (
- corelog "log"
+ "log"
"log/syslog"
- "os"
)
-var log *corelog.Logger
-
-func init() {
- log = corelog.New(os.Stderr, "", 0)
- log.SetFlags(corelog.LstdFlags)
-}
-
func initLogger(slog bool) {
if slog {
lw, err := syslog.New(syslog.LOG_INFO, "cbfs")
if err != nil {
- corelog.Fatalf("Can't initialize logger: %v", err)
+ log.Fatalf("Can't initialize syslog: %v", err)
}
- log = corelog.New(lw, "", 0)
+ log.SetOutput(lw)
}
}
View
@@ -4,6 +4,7 @@ import (
"encoding/json"
"flag"
"fmt"
+ "log"
"math/rand"
"net/http"
"os"
View
@@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
+ "log"
"math/rand"
"net/http"
"sort"
View
1 tar.go
@@ -3,6 +3,7 @@ package main
import (
"archive/tar"
"compress/gzip"
+ "log"
"net/http"
)
View
@@ -6,6 +6,7 @@ import (
"errors"
"flag"
"fmt"
+ "log"
"math/rand"
"strings"
"time"
View
1 zip.go
@@ -4,6 +4,7 @@ import (
"archive/zip"
"encoding/json"
"errors"
+ "log"
"net/http"
"strings"

0 comments on commit a404ea2

Please sign in to comment.