Skip to content

Commit

Permalink
Move logger to separate package
Browse files Browse the repository at this point in the history
  • Loading branch information
xperimental committed Jun 10, 2022
1 parent 0f4e27c commit 7d07aab
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions log/static.go → log/static/static.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
package log
// Package static provides a simple static logger implementation for easy migration of existing pre-v2 code.
//
// The package is usually imported aliased as "log" to be compatible with the v1 approach.
//
// The static logger instance needs to be initialized during startup of the application using SetLogger.
package static

import (
"sync"

"github.com/ViaQ/logerr/v2/log"
"github.com/go-logr/logr"
)

var (
lock sync.RWMutex
logger = NewLogger("uninitialized")
logger = log.NewLogger("uninitialized")
)

// SetLogger sets the static logger instance.
Expand Down

0 comments on commit 7d07aab

Please sign in to comment.