Hi,

i just stumbled upon logging in management commands I saw that there is
an own system of logging.

When creating custom mgmt cmds, you have to write logging output to

    if options["verbosity"] >= 2:
        sys.stdout.write(message)

this is a little inconvenient, and much less DRY as e.g.

    logger.info(message)

But logger does not really work as intended in commands.

Was this a good choice? Yes, log levels can be changed using settings.py.

But: wouldn't it be convenient to use the system logger for that too in
Django?


My background is: I have made a plugin system, and I would have to add
the "verbosity" parameter to every plugin hook that is ought to print
out some logging strings. It would be a lot easier to use logger.warning
e.g. for that.

Could the 4 verbosity levels just be tied to debug,info, warning, error
of python's logging module as default?

Thanks,
Christian

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/ea45651c-bef9-2b41-5546-1365776c7b2e%40nerdocs.at.

Attachment: pEpkey.asc
Description: application/pgp-keys

Reply via email to