Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What's so clunky? It scales nicely. Simplest thing just works, when you need more, you can learn just enough to get what you want.

    import logging as log
    log.warning("groupthink says it sucks")
    log.error("omg wtf, so hard!!!")

    log.basicConfig(filename='ignorance.log',level=log.DEBUG)
    log.debug("rtfm", exc_info=True)
And so on; formatting, handlers, multiple loggers, config files, proper lib logging, etc. All very pluggable and extendable, but only if you need it.

There's a basic tutorial, advanced tutorial and a cookbook. http://docs.python.org/library/logging.html



I'm not sure taking a shot at the parent poster is terribly nice, even if you're doing it as part of a code example.

(Groupthink, ignorance, RTFM? Seriously?)


That's a shot at the many people posting here and elsewhere about how "horrible" logging module is. Most of whom I suspect (cause it ain't that bad) are jumping on the hatewagon without actual investigation of the module.




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

Search: