diff --git a/chess.go b/chess.go index 8b95d28..c38a7d6 100644 --- a/chess.go +++ b/chess.go @@ -69,11 +69,12 @@ func chessCommand(m chat1.MsgSummary) { func showBoard(m chat1.MsgSummary, g *Game) { defer log.PanicSafe("showBoard") // create file + log.LogInfo("Creating file for %+v.svg", m.ConvID) f, err := os.Create(fmt.Sprintf("/home/chessbot/chessbot/games/%+v.svg", m.ConvID)) if err != nil { log.LogError(fmt.Sprintf("Error in ShowBoard os.Create: %+v\n", err)) } - + log.LogInfo("Creating board position (g.Game.Position().String())") // create board position fenStr := g.Game.Position().String() pos := &chess.Position{} @@ -95,6 +96,7 @@ func showBoard(m chat1.MsgSummary, g *Game) { } } + log.LogInfo("Closing file.") f.Close() if svgToPNG(fmt.Sprintf("/home/chessbot/chessbot/games/%+v", m.ConvID)) { k.UploadToConversation(m.ConvID, "", fmt.Sprintf("/home/chessbot/chessbot/games/%+v.png", m.ConvID)) diff --git a/main.go b/main.go index 93ac278..24f616b 100755 --- a/main.go +++ b/main.go @@ -33,7 +33,6 @@ func printChat(m chat1.MsgSummary) { chessCommand(m) return } - log.LogInfo("%s: %s\n", m.Sender.Username, m.Content.Text.Body) } func main() { fmt.Println("Loading config.")