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:
Leonor Oliveira
2025-04-08 15:35:11 +02:00
committed by GitHub
parent d32f47847c
commit a9ef8bcced
26 changed files with 101 additions and 98 deletions

View File

@ -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)