mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-22 02:47:48 +08:00
refactor(eventlog) elog -> eventlog
License: MIT Signed-off-by: Brian 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: Brian Tiger Chow <brian.holderchow@gmail.com>
This commit is contained in:
parent
ac69aba561
commit
25c98e8e61
@ -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
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package elog
|
||||
package eventlog
|
||||
|
||||
import (
|
||||
"errors"
|
||||
@ -1,4 +1,4 @@
|
||||
package elog
|
||||
package eventlog
|
||||
|
||||
import (
|
||||
"testing"
|
||||
@ -1,4 +1,4 @@
|
||||
package elog
|
||||
package eventlog
|
||||
|
||||
import (
|
||||
"time"
|
||||
@ -1,4 +1,4 @@
|
||||
package elog
|
||||
package eventlog
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
@ -1,4 +1,4 @@
|
||||
package elog
|
||||
package eventlog
|
||||
|
||||
import "testing"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package elog
|
||||
package eventlog
|
||||
|
||||
import (
|
||||
"io"
|
||||
Loading…
Reference in New Issue
Block a user