Re: django command logging levels

2019-02-16 Thread co16326 . ccet
Thank U for help. I will check the links to get more info :-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/67a11408-35b4-4079-8249-9566d396ca07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django command logging levels

2019-02-16 Thread Jason
however, if you want to incorporate logging levels, like DEBUG, INFO, WARN 
in your management commands and have them correspond to a verbosity level 
check out 
https://www.crccheck.com/blog/django-management-commands-and-verbosity/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1807aa4d-3eab-4913-b05a-162050a40738%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django command logging levels

2019-02-16 Thread Jason
verbosity is varying levels of output.  management commands output to 
stdout directly, which is different from logging.

I would suggest you look at the implementation of the included django 
management commands 
 
and see how they handle verbosity settings.  For example, makemigrations 

 has 
different levels of output when you search for *verbosity*

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/35c05cff-cabf-445c-a6df-ccf3edf7c14c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django command logging levels

2019-02-16 Thread co16326 . ccet
But I have added a logger setting in my django settings file, then also do 
I have to add verbosity setting arg in my custom management command ?

On Saturday, February 16, 2019 at 4:12:07 AM UTC+5:30, Dan Davis wrote:
>
> The common verbosity will be passed to the handler:
>
> class Command(BaseCommand):
> ...
> def handler(**kwargs):
>  verbosity = kwargs['verbosity']
>
>
> I tried to get clever once and not have **kwargs, but Django sends that 
> common stuff, like '--settings", and it is good for me to pay attention.
>
> OTOH, if you want to know whether this has anything to do with Python's 
> logging module, it doesn't - that all depends on your settings file 
> contents.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/09c9d0c9-3c06-4f18-af3d-b9c1b6c8730d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django command logging levels

2019-02-15 Thread Dan Davis
The common verbosity will be passed to the handler:

class Command(BaseCommand):
...
def handler(**kwargs):
 verbosity = kwargs['verbosity']


I tried to get clever once and not have **kwargs, but Django sends that 
common stuff, like '--settings", and it is good for me to pay attention.

OTOH, if you want to know whether this has anything to do with Python's 
logging module, it doesn't - that all depends on your settings file 
contents.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e6e1936a-d45d-4212-acfc-be79d2cb328a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django command logging levels

2019-02-15 Thread co16326 . ccet


Django command interface has the following CLI arg

  -v {0,1,2,3}, --verbosity {0,1,2,3}
Verbosity level; 0=minimal output, 1=normal output,
2=verbose output, 3=very verbose output

It doesn't connect with the logging levels used by the commands, so the 
commands don't show extra information.

So is this an incompatibility or I have to add some arguments to my custom 
management commands ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c2591645-5950-4969-98b3-afdb8b7c3ce6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.