Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Daquiri – logging for Python that works by default (danjou.info)
1 point by xmm on Aug 5, 2017 | hide | past | favorite | 1 comment


> Each time I write a new application, I need to remember how to set logging up.

You mean, like this?

  import logging.config
  import yaml

  with open(log_config_file) as f:
      logging.config.dictConfig(yaml.safe_load(f))
Because this is the correct way that allows the user to supply their own configuration that is not tied tightly to your little program.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: