From bb7615bcf9aaa69b6c479d56c77434a47fe0bf5c Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Sat, 30 Dec 2023 15:13:29 -0700 Subject: [PATCH] signalmeow/profile: use structured logging Signed-off-by: Sumner Evans --- pkg/signalmeow/profile.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/signalmeow/profile.go b/pkg/signalmeow/profile.go index 0a9aba18..0826b639 100644 --- a/pkg/signalmeow/profile.go +++ b/pkg/signalmeow/profile.go @@ -209,7 +209,9 @@ func fetchProfileByID(ctx context.Context, d *Device, signalID string) (*Profile path := "/v1/profile/" + signalID useUnidentified := profileKeyVersion != nil && accessKey != nil if useUnidentified { - zlog.Trace().Msgf("Using unidentified profile request with profileKeyVersion: %v", profileKeyVersion) + zlog.Trace(). + Hex("profile_key_version", profileKeyVersion[:]). + Msg("Using unidentified profile request") // Assuming we can just make the version bytes into a string path += "/" + profileKeyVersion.String() } @@ -286,7 +288,7 @@ func fetchAndDecryptAvatarImage(d *Device, avatarPath string, profileKey *libsig Username: &username, Password: &password, } - zlog.Info().Msgf("Fetching profile avatar from %v", avatarPath) + zlog.Info().Str("avatar_path", avatarPath).Msg("Fetching profile avatar") resp, err := web.SendHTTPRequest("GET", avatarPath, opts) if err != nil { zlog.Err(err).Msg("error fetching profile avatar")