Commit 25c98e8e authored by Brian Tiger Chow's avatar Brian Tiger Chow

refactor(eventlog) elog -> eventlog

License: MIT
Signed-off-by: default avatarBrian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)
Signed-off-by: default avatarBrian Tiger Chow <brian.holderchow@gmail.com>
parent ac69aba5
......@@ -22,11 +22,11 @@ import (
updates "github.com/jbenet/go-ipfs/updates"
u "github.com/jbenet/go-ipfs/util"
errors "github.com/jbenet/go-ipfs/util/debugerror"
elog "github.com/jbenet/go-ipfs/util/elog"
eventlog "github.com/jbenet/go-ipfs/util/elog"
)
// log is the command logger
var log = elog.Logger("cmd/ipfs")
var log = eventlog.Logger("cmd/ipfs")
// signal to output help
var errHelpRequested = errors.New("Help Requested")
......@@ -496,20 +496,20 @@ func allInterruptSignals() chan os.Signal {
func configureEventLogger(config *config.Config) error {
if u.Debug {
elog.Configure(elog.LevelDebug)
eventlog.Configure(eventlog.LevelDebug)
} else {
elog.Configure(elog.LevelInfo)
eventlog.Configure(eventlog.LevelInfo)
}
elog.Configure(elog.LdJSONFormatter)
eventlog.Configure(eventlog.LdJSONFormatter)
rotateConf := elog.LogRotatorConfig{
rotateConf := eventlog.LogRotatorConfig{
Filename: config.Logs.Filename,
MaxSizeMB: config.Logs.MaxSizeMB,
MaxBackups: config.Logs.MaxBackups,
MaxAgeDays: config.Logs.MaxAgeDays,
}
elog.Configure(elog.OutputRotatingLogFile(rotateConf))
eventlog.Configure(eventlog.OutputRotatingLogFile(rotateConf))
return nil
}
......@@ -54,12 +54,12 @@ func resolveUnspecifiedAddresses(unspecifiedAddrs []ma.Multiaddr) ([]ma.Multiadd
}
}
log.Event(context.TODO(), "interfaceListenAddresses", func() elog.Loggable {
log.Event(context.TODO(), "interfaceListenAddresses", func() eventlog.Loggable {
var addrs []string
for _, addr := range outputAddrs {
addrs = append(addrs, addr.String())
}
return elog.Metadata{"addresses": addrs}
return eventlog.Metadata{"addresses": addrs}
}())
log.Info("InterfaceListenAddresses:", outputAddrs)
return outputAddrs, nil
......
......@@ -19,7 +19,7 @@ import (
ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
)
var log = elog.Logger("swarm")
var log = eventlog.Logger("swarm")
// ErrAlreadyOpen signals that a connection to a peer is already open.
var ErrAlreadyOpen = errors.New("Error: Connection to this peer already open.")
......
......@@ -26,7 +26,7 @@ import (
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
)
var log = elog.Logger("dht")
var log = eventlog.Logger("dht")
const doPinging = false
......
package elog
package eventlog
import (
"errors"
......
package elog
package eventlog
import (
"testing"
......
package elog
package eventlog
import (
"time"
......
package elog
package eventlog
import (
"encoding/json"
......
package elog
package eventlog
import (
"io"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment