Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Logging pytchat

taizan-hokuto edited this page Jan 18, 2020 · 2 revisions

By default, outputs of logger are all invisible.

By setting logger parameter, you can use any customized logger.

Internal logger config.logger is also available.

Example

from pytchat import LiveChat, config, logging
chat = LiveChat(video_id = "Zvp1pJpie4I", 
                logger = config.logger(__name__, logging.DEBUG))

while chat.is_alive():
  try:
    data = chat.get()
    items = data.items
    for c in items:
        print(f"{c.datetime} [{c.author.name}]- {c.message}")
        data.tick()
  except KeyboardInterrupt:
    chat.terminate()
    break
Clone this wiki locally