Skip to content

Commit 2c7a95a

Browse files
committed
fix: Windows build — use logging.Logger in terminal manager, share testLogger helper
The Windows-specific terminal manager still referenced *zap.SugaredLogger after the non-Windows variant was updated to the SDK logging interface. Also extracted testLogger into a shared helpers_test.go so plugin tests compile on all platforms.
1 parent 14e64a7 commit 2c7a95a

3 files changed

Lines changed: 15 additions & 10 deletions

File tree

backend/pkg/plugin/helpers_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package plugin
2+
3+
import (
4+
"testing"
5+
6+
logging "github.com/omniviewdev/plugin-sdk/log"
7+
)
8+
9+
func testLogger(t *testing.T) logging.Logger {
10+
t.Helper()
11+
return logging.NewNop()
12+
}

backend/pkg/plugin/pids_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,8 @@ import (
1111

1212
"github.com/stretchr/testify/assert"
1313
"github.com/stretchr/testify/require"
14-
logging "github.com/omniviewdev/plugin-sdk/log"
1514
)
1615

17-
func testLogger(t *testing.T) logging.Logger {
18-
t.Helper()
19-
return logging.NewNop()
20-
}
21-
2216
func TestPluginPIDTracker_RecordAndRemove(t *testing.T) {
2317
tracker := NewPluginPIDTracker()
2418

backend/pkg/terminal/manager_windows.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import (
77
"os"
88
"sync"
99

10-
"go.uber.org/zap"
11-
10+
logging "github.com/omniviewdev/plugin-sdk/log"
1211
sdkexec "github.com/omniviewdev/plugin-sdk/pkg/v1/exec"
1312
"github.com/omniviewdev/plugin-sdk/pkg/types"
1413
)
@@ -18,7 +17,7 @@ var errUnsupported = fmt.Errorf("terminal sessions are not supported on Windows"
1817
// Manager manages terminal sessions. On Windows, PTY-based sessions are not
1918
// supported, so all operations return errors.
2019
type Manager struct {
21-
log *zap.SugaredLogger
20+
log logging.Logger
2221
sessions map[string]*sdkexec.Session
2322
ptys map[string]*os.File
2423

@@ -29,7 +28,7 @@ type Manager struct {
2928
}
3029

3130
func NewManager(
32-
log *zap.SugaredLogger,
31+
log logging.Logger,
3332
) (*Manager, chan sdkexec.StreamInput, chan sdkexec.StreamOutput, chan sdkexec.StreamResize) {
3433
inMux := make(chan sdkexec.StreamInput)
3534
outMux := make(chan sdkexec.StreamOutput)

0 commit comments

Comments
 (0)