mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 05:08:36 +08:00
Use logging from app sdk in the resource mod (#103281)
* Use logging from app sdk in the resource mod * make update-workspace * Use app-sdk logging in SQL backend * Use grafana-app logging in tests * make update-workspace * make update-workspace * make update-workspace * Use default logging * Remove dependency on grafana/grafana * Fix imports
This commit is contained in:
@ -5,7 +5,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana-app-sdk/logging"
|
||||
"github.com/grafana/grafana/pkg/storage/unified/resource"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@ -15,7 +15,7 @@ func TestChannelNotifier(t *testing.T) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
|
||||
defer cancel()
|
||||
|
||||
n := newChannelNotifier(5, log.NewNopLogger())
|
||||
n := newChannelNotifier(5, &logging.NoOpLogger{})
|
||||
|
||||
events, err := n.notify(ctx)
|
||||
require.NoError(t, err)
|
||||
@ -42,7 +42,7 @@ func TestChannelNotifier(t *testing.T) {
|
||||
|
||||
t.Run("should drop events when buffer is full", func(t *testing.T) {
|
||||
bufferSize := 2
|
||||
n := newChannelNotifier(bufferSize, log.NewNopLogger())
|
||||
n := newChannelNotifier(bufferSize, &logging.NoOpLogger{})
|
||||
|
||||
events, err := n.notify(context.Background())
|
||||
require.NoError(t, err)
|
||||
@ -58,7 +58,7 @@ func TestChannelNotifier(t *testing.T) {
|
||||
|
||||
t.Run("should close subscriber channels when context cancelled", func(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
n := newChannelNotifier(5, log.NewNopLogger())
|
||||
n := newChannelNotifier(5, &logging.NoOpLogger{})
|
||||
|
||||
events, err := n.notify(ctx)
|
||||
require.NoError(t, err)
|
||||
|
Reference in New Issue
Block a user