<commit_before>package main

import (
  "fmt"
  "xmpp"
)

type Bot struct {
}

func (b *Bot) onMessage(message string) {
  log("Bot received message: %s", message)
}

func (b *Bot) onUnkown(msg string) {
  log("Bot received unsupported message: %s", msg)
}

func main() {
  bot := Bot{}

  client, err := xmpp.NewClient("talk.google.com", "<EMAIL>", "XXX")

  if err != nil {
    fmt.Printf("Failed due to: %s\n", err)
  } else {
    client.OnMessage(func(msg string ) {
      bot.onMessage(msg)
    })

    client.Message("<EMAIL>", "Hello world!")

    client.Loop()
  }
}

func log(format string, args ...interface{}) {
  fmt.Printf("MAIN LOG: " + format, args...)
}
<commit_msg>Made use of onAny to enable logging.<commit_after>package main

import (
  "fmt"
  "xmpp"
)

type Bot struct {
}

func (b *Bot) onMessage(message string) {
  log("Bot received message: %s", message)
}

func (b *Bot) onUnkown(msg string) {
  log("Bot received unsupported message: %s", msg)
}

func main() {
  bot := Bot{}

  client, err := xmpp.NewClient("talk.google.com", "<EMAIL>", "XXX")

  if err != nil {
    fmt.Printf("Failed due to: %s\n", err)
  } else {
    client.OnAny(func(msg string) {
      log(msg)
    })

    client.OnMessage(func(msg string) {
      bot.onMessage(msg)
    })

    client.Message("<EMAIL>", "Hello world!")

    client.Loop()
  }
}

func log(format string, args ...interface{}) {
  fmt.Printf("MAIN LOG: " + format + "\n", args...)
}

{'fraction_non_alphanumeric': 0.18181818181818182, 'fraction_numerical': 0.0, 'mean_word_length': 3.163323782234957, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '838269', 'n_tokens_mistral': 541, 'n_tokens_neox': 530, 'n_words': 136}