]> git.giacomolli.uk - onechat/blobdiff - whatsapp_fake_helper_test.go
Back up the daemon and restore its data
[onechat] / whatsapp_fake_helper_test.go
index 1625fe3b8729b9c3f9240e161797903229462c24..d8bb9bb310a4d15ce31fa45e07026408f6ff0d6a 100644 (file)
@@ -3,8 +3,7 @@ package main
 import (
        "context"
        "fmt"
 import (
        "context"
        "fmt"
-       "io"
-       "log"
+       "log/slog"
        "os"
        "path/filepath"
        "slices"
        "os"
        "path/filepath"
        "slices"
@@ -261,7 +260,7 @@ func whatsappStartTest(t *testing.T, dir string, clock *TestClock) (*WhatsApp, *
        }
 
        logs := &SyncBuffer{}
        }
 
        logs := &SyncBuffer{}
-       whatsapp, err := openWhatsApp(t.Context(), dir, clock.Now, log.New(logs, "", 0), fake.newClient)
+       whatsapp, err := openWhatsApp(t.Context(), dir, clock.Now, daemonTestLogger(logs), fake.newClient)
        require.NoError(t, err)
 
        t.Cleanup(func() {
        require.NoError(t, err)
 
        t.Cleanup(func() {
@@ -306,8 +305,8 @@ func whatsappTestSession(t *testing.T, dir string, linked bool) {
 }
 
 // whatsappDiscardLog is a logger for a WhatsApp whose log a test does not read.
 }
 
 // whatsappDiscardLog is a logger for a WhatsApp whose log a test does not read.
-func whatsappDiscardLog() *log.Logger {
-       return log.New(io.Discard, "", 0)
+func whatsappDiscardLog() *slog.Logger {
+       return slog.New(slog.DiscardHandler)
 }
 
 // whatsappTestMessage returns the event of the text message id of sender in
 }
 
 // whatsappTestMessage returns the event of the text message id of sender in