[contrib.staticfiles] Change verbosity level of collectstatic command's outputs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[contrib.staticfiles] Change verbosity level of collectstatic command's outputs

Tanguy Nodet
This is a repost of this ticket, which was obviously in the wrong place.

I have a suggestion concerning the logging of the collectstatic command.
Presently, with the default verbosity level (1), individual information on each copied or linked file are printed to sdtout, resulting in a log looking like this:
Copying  '/path/to/the/file'
# or
Linking '/path/to/the/file'
# [...dozens if not hundreds of other lines...]
187 static files copied to '/var/www/my_site/static'.

Now providing the command is launched at every startup of the server (and that you restart your server often, for example in development), this can result in pretty heavy and "polluted" server logs.

If you use verbosity level 0, no output whatsoever is printed (obviously).
Plus, in several cases, the output for verbosity levels 1 and 2 are the same.
Looking at the ​collectstatic source code, only skipped operations (for post-processing, linking, copy, deletion with --clear) and deletion (of previously copied files that got modified) are logged with a verbosity level of 2.

In my opinion, it would be nice to shift the lines concerning individual files to a verbosity level of 2, and keep the summary at a verbosity level of 1.
I think it would also bring consistency with other commands, such as loaddata, which only displays its summary (at a verbosity level of 1):
Installed 42 object(s) from 7 fixture(s)

What are your thoughts?
Cheers!

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/266d9ab5-e916-4eb4-9a24-52ac0a264d00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [contrib.staticfiles] Change verbosity level of collectstatic command's outputs

Aymeric Augustin
Hello,

The ticket tracker wasn't _obviously_ the wrong place :-) but the mailing list is a better way to draw the attention of many people to an issue that requires discussion.

I agree that the default logging is needlessly verbose and that's annoying.

Printing information about every file should be moved to level 2. Aggregate information (e.g. N files copied, M files postprocessed) should remain at level 1.

Best regards,

-- 
Aymeric.


2018-01-04 11:10 GMT+01:00 Tanguy Nodet <[hidden email]>:
This is a repost of this ticket, which was obviously in the wrong place.

I have a suggestion concerning the logging of the collectstatic command.
Presently, with the default verbosity level (1), individual information on each copied or linked file are printed to sdtout, resulting in a log looking like this:
Copying  '/path/to/the/file'
# or
Linking '/path/to/the/file'
# [...dozens if not hundreds of other lines...]
187 static files copied to '/var/www/my_site/static'.

Now providing the command is launched at every startup of the server (and that you restart your server often, for example in development), this can result in pretty heavy and "polluted" server logs.

If you use verbosity level 0, no output whatsoever is printed (obviously).
Plus, in several cases, the output for verbosity levels 1 and 2 are the same.
Looking at the ​collectstatic source code, only skipped operations (for post-processing, linking, copy, deletion with --clear) and deletion (of previously copied files that got modified) are logged with a verbosity level of 2.

In my opinion, it would be nice to shift the lines concerning individual files to a verbosity level of 2, and keep the summary at a verbosity level of 1.
I think it would also bring consistency with other commands, such as loaddata, which only displays its summary (at a verbosity level of 1):
Installed 42 object(s) from 7 fixture(s)

What are your thoughts?
Cheers!

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/266d9ab5-e916-4eb4-9a24-52ac0a264d00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Aymeric.

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CANE-7mUmkK%2B5V7bV_qpbi5CR2hYwvQqVrjo1mtmwY1HkY2TetQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.