Skip to content

Commit

Permalink
Fix app logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkren committed Oct 23, 2019
1 parent a01b917 commit e78f45d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pkg/app2/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ func TimestampFromLog(log string) string {
return log[1:36]
}

func (a *App) newPersistentLogger(path string) (*logging.MasterLogger, LogStore, error) {
db, err := newBoltDB(path, a.config.AppName)
func newPersistentLogger(path, appName string) (*logging.MasterLogger, LogStore, error) {
db, err := newBoltDB(path, appName)
if err != nil {
return nil, nil, err
}
Expand Down
10 changes: 3 additions & 7 deletions pkg/app2/log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@ func TestNewLogger(t *testing.T) {

defer os.Remove(p.Name()) // nolint

a := &App{
config: Config{
AppName: "foo",
},
}
appName := "foo"

l, _, err := a.newPersistentLogger(p.Name())
l, _, err := newPersistentLogger(p.Name(), appName)
require.NoError(t, err)

dbl, err := newBoltDB(p.Name(), a.config.AppName)
dbl, err := newBoltDB(p.Name(), appName)
require.NoError(t, err)

l.Info("bar")
Expand Down

0 comments on commit e78f45d

Please sign in to comment.