Skip to content

Commit

Permalink
Use debug logger when ACTIONLOG_DEBUG=true
Browse files Browse the repository at this point in the history
  • Loading branch information
darh committed Jan 11, 2021
1 parent 1317939 commit 2eea2ad
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion compose/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package service
import (
"context"
"fmt"
"github.com/cortezaproject/corteza-server/pkg/logger"
"strconv"
"time"

Expand Down Expand Up @@ -93,7 +94,7 @@ func Initialize(ctx context.Context, log *zap.Logger, s store.Storer, c Config)
policy = actionlog.MakeDisabledPolicy()
} else if c.ActionLog.Debug {
policy = actionlog.MakeDebugPolicy()
tee = log
tee = logger.MakeDebugLogger()
}

DefaultActionlog = actionlog.NewService(DefaultStore, log, tee, policy)
Expand Down
3 changes: 2 additions & 1 deletion federation/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package service

import (
"context"
"github.com/cortezaproject/corteza-server/pkg/logger"
"time"

cs "github.com/cortezaproject/corteza-server/compose/service"
Expand Down Expand Up @@ -77,7 +78,7 @@ func Initialize(ctx context.Context, log *zap.Logger, s store.Storer, c Config)
policy = actionlog.MakeDisabledPolicy()
} else if c.ActionLog.Debug {
policy = actionlog.MakeDebugPolicy()
tee = log
tee = logger.MakeDebugLogger()
}

DefaultActionlog = actionlog.NewService(DefaultStore, log, tee, policy)
Expand Down
3 changes: 2 additions & 1 deletion messaging/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package service

import (
"context"
"github.com/cortezaproject/corteza-server/pkg/logger"
"time"

"github.com/cortezaproject/corteza-server/pkg/actionlog"
Expand Down Expand Up @@ -83,7 +84,7 @@ func Initialize(ctx context.Context, log *zap.Logger, s store.Storer, c Config)
policy = actionlog.MakeDisabledPolicy()
} else if c.ActionLog.Debug {
policy = actionlog.MakeDebugPolicy()
tee = log
tee = logger.MakeDebugLogger()
}

DefaultActionlog = actionlog.NewService(DefaultStore, log, tee, policy)
Expand Down
3 changes: 2 additions & 1 deletion system/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package service
import (
"context"
"errors"
"github.com/cortezaproject/corteza-server/pkg/logger"
"time"

"github.com/cortezaproject/corteza-server/pkg/actionlog"
Expand Down Expand Up @@ -119,7 +120,7 @@ func Initialize(ctx context.Context, log *zap.Logger, s store.Storer, c Config)
policy = actionlog.MakeDisabledPolicy()
} else if c.ActionLog.Debug {
policy = actionlog.MakeDebugPolicy()
tee = log
tee = logger.MakeDebugLogger()
}

DefaultActionlog = actionlog.NewService(DefaultStore, log, tee, policy)
Expand Down

0 comments on commit 2eea2ad

Please sign in to comment.