Skip to content

Commit

Permalink
chore: Enshrine defra logger names
Browse files Browse the repository at this point in the history
  • Loading branch information
orpheuslummis committed Apr 27, 2023
1 parent f0d7fe0 commit e0f47be
Show file tree
Hide file tree
Showing 20 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion api/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ package http

import "github.com/sourcenetwork/defradb/logging"

var log = logging.MustNewLogger("defra.http")
var log = logging.MustNewLogger("http")
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/sourcenetwork/defradb/logging"
)

var log = logging.MustNewLogger("defra.cli")
var log = logging.MustNewLogger("cli")

const badgerDatastoreName = "badger"

Expand Down
2 changes: 1 addition & 1 deletion cmd/genclidocs/genclidocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/sourcenetwork/defradb/logging"
)

var log = logging.MustNewLogger("defra.genclidocs")
var log = logging.MustNewLogger("genclidocs")

func main() {
path := flag.String("o", "docs/cmd", "path to write the cmd docs to")
Expand Down
2 changes: 1 addition & 1 deletion cmd/genmanpages/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

const defaultPerm os.FileMode = 0o777

var log = logging.MustNewLogger("defra.genmanpages")
var log = logging.MustNewLogger("genmanpages")

func main() {
dirFlag := flag.String("o", "build/man", "Directory in which to generate DefraDB man pages")
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import (
"github.com/sourcenetwork/defradb/node"
)

var log = logging.MustNewLogger("defra.config")
var log = logging.MustNewLogger("config")

const (
DefaultAPIEmail = "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion datastore/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

var (
log = logging.MustNewLogger("defradb.store")
log = logging.MustNewLogger("store")
)

// RootStore wraps Batching and TxnDatastore requiring datastore to support both batching and transactions.
Expand Down
2 changes: 1 addition & 1 deletion db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
)

var (
log = logging.MustNewLogger("defra.db")
log = logging.MustNewLogger("db")
)

// make sure we match our client interface
Expand Down
1 change: 1 addition & 0 deletions logging/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ func toZapFields(keyvals []KV) []zap.Field {
}

func (l *logger) ApplyConfig(config Config) {
fmt.Println(l.name, "ApplyConfig", config)
newLogger, err := buildZapLogger(l.name, config)
if err != nil {
l.logger.Error("Error applying config to logger", zap.Error(err))
Expand Down
2 changes: 1 addition & 1 deletion logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"context"
)

var log = MustNewLogger("defra.logging")
var log = MustNewLogger("logging")

// KV is a key-value pair used to pass structured data to loggers.
type KV struct {
Expand Down
2 changes: 1 addition & 1 deletion merkle/clock/clock.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
)

var (
log = logging.MustNewLogger("defra.merkleclock")
log = logging.MustNewLogger("merkleclock")
)

// MerkleClock is a MerkleCRDT clock that can be used to read/write events (deltas) to the clock.
Expand Down
2 changes: 1 addition & 1 deletion merkle/crdt/merklecrdt.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
)

var (
log = logging.MustNewLogger("defra.merklecrdt")
log = logging.MustNewLogger("merklecrdt")
)

// MerkleCRDT is the implementation of a Merkle Clock along with a
Expand Down
2 changes: 1 addition & 1 deletion net/api/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
)

var (
log = logging.MustNewLogger("defra.netapi")
log = logging.MustNewLogger("netapi")
)

type Service struct {
Expand Down
2 changes: 1 addition & 1 deletion net/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ import (
)

var (
log = logging.MustNewLogger("defra.net")
log = logging.MustNewLogger("net")
)
2 changes: 1 addition & 1 deletion node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import (
)

var (
log = logging.MustNewLogger("defra.node")
log = logging.MustNewLogger("node")
)

const evtWaitTimeout = 10 * time.Second
Expand Down
2 changes: 1 addition & 1 deletion planner/planner.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
)

var (
log = logging.MustNewLogger("defra.planner")
log = logging.MustNewLogger("planner")
)

// planNode is an interface all nodes in the plan tree need to implement.
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/bench_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const (

var (
storage string = "memory"
log = logging.MustNewLogger("defra.tests.bench")
log = logging.MustNewLogger("tests.bench")
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/query/simple/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
)

var (
// log = logging.MustNewLogger("defra.bench")
// log = logging.MustNewLogger("bench")
)

func runQueryBenchGet(
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/explain/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
)

var (
log = logging.MustNewLogger("defra.tests.integration.explain")
log = logging.MustNewLogger("tests.integration.explain")

allPlanNodeNames = map[string]struct{}{
// Not a planNode but need it here as this is root of the explain graph.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/net/order/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
)

var (
log = logging.MustNewLogger("defra.test.net")
log = logging.MustNewLogger("test.net")
)

const (
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/utils2.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const (
)

var (
log = logging.MustNewLogger("defra.tests.integration")
log = logging.MustNewLogger("tests.integration")
badgerInMemory bool
badgerFile bool
inMemoryStore bool
Expand Down

0 comments on commit e0f47be

Please sign in to comment.