diff options
| author | Jeff Carr <[email protected]> | 2025-08-22 04:00:41 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-08-22 04:00:41 -0500 |
| commit | 76ef21fc66db127098ddd634fd7e2a52abb81193 (patch) | |
| tree | d55e5523990eff367ddd60d251cf7c587cd555bf /doPlayback.go | |
| parent | 8f9726c6e47c2c722137f2d2aabe4c507ece5c14 (diff) | |
new logging
Diffstat (limited to 'doPlayback.go')
| -rw-r--r-- | doPlayback.go | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/doPlayback.go b/doPlayback.go index 9ece30e..e636004 100644 --- a/doPlayback.go +++ b/doPlayback.go @@ -3,6 +3,7 @@ package main import ( "fmt" + "go.wit.com/lib/protobuf/chatpb" "go.wit.com/log" ) @@ -12,10 +13,24 @@ func doPlayback() { return } - log.Infof("Found %d chat topic(s) in the log.", len(me.chats.GetChats())) + listChats(me.chats) +} + +func showChat(uuid string) { + chat := me.chats.FindByUuid(uuid) + if chat == nil { + log.Info("unknown uuid", uuid) + return + } + // Call the new, dedicated formatting function. + prettyFormatChat(chat) +} + +func listChats(chats *chatpb.Chats) { + log.Infof("Found %d chat topic(s) in the log.", len(chats.GetChats())) fmt.Println("-------------------------------------------------") - for _, chat := range me.chats.GetChats() { + for _, chat := range chats.GetChats() { entryCount := len(chat.GetEntries()) var formattedTime string if ctime := chat.GetCtime(); ctime != nil { @@ -34,13 +49,3 @@ func doPlayback() { } fmt.Println("-------------------------------------------------") } - -func showChat(uuid string) { - chat := me.chats.FindByUuid(uuid) - if chat == nil { - log.Info("unknown uuid", uuid) - return - } - // Call the new, dedicated formatting function. - prettyFormatChat(chat) -} |
