[Django] #28973: Change verbosity level of collectstatic command's outputs

32 views
Skip to first unread message

Django

unread,
Dec 29, 2017, 11:06:19 AM12/29/17
to django-...@googlegroups.com
#28973: Change verbosity level of collectstatic command's outputs
-------------------------------------+-------------------------------------
Reporter: Tanguy | Owner: nobody
Nodet |
Type: | Status: new
Cleanup/optimization |
Component: Core | Version: master
(Management commands) | Keywords: collecstatic
Severity: Normal | verbosity log logging management
Triage Stage: | command
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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
[https://github.com/django/django/blob/master/django/contrib/staticfiles/management/commands/collectstatic.py
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)
}}}

Cheers!

--
Ticket URL: <https://code.djangoproject.com/ticket/28973>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 2, 2018, 10:35:51 AM1/2/18
to django-...@googlegroups.com
#28973: Change verbosity level of collectstatic command's outputs
-------------------------------------+-------------------------------------
Reporter: Tanguy Nodet | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution:
Keywords: collecstatic | Triage Stage:
verbosity log logging management | Unreviewed
command |

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* component: Core (Management commands) => contrib.staticfiles


Comment:

I don't know. Generally if you want to revisit a design decision like
that, it's better to post on the DevelopersMailingList because it reaches
a wider audience.

--
Ticket URL: <https://code.djangoproject.com/ticket/28973#comment:1>

Django

unread,
Jan 4, 2018, 4:49:08 AM1/4/18
to django-...@googlegroups.com
#28973: Change verbosity level of collectstatic command's outputs
-------------------------------------+-------------------------------------
Reporter: Tanguy Nodet | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution:
Keywords: collecstatic | Triage Stage:
verbosity log logging management | Unreviewed
command |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tanguy Nodet):

Replying to [comment:1 Tim Graham]:


> I don't know. Generally if you want to revisit a design decision like
that, it's better to post on the DevelopersMailingList because it reaches
a wider audience.

Okay, will do. Thank you for your advice.

--
Ticket URL: <https://code.djangoproject.com/ticket/28973#comment:2>

Django

unread,
Jan 10, 2018, 1:46:21 PM1/10/18
to django-...@googlegroups.com
#28973: Move the output of every file that collectstatic processes to verbosity
level 2

-------------------------------------+-------------------------------------
Reporter: Tanguy Nodet | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution:
Keywords: collecstatic | Triage Stage: Accepted
verbosity log logging management |
command |

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted


Comment:

Tentatively accepting as per [https://groups.google.com/d/topic/django-
developers/LAQyOQ1dMEA/discussion django-developers discussion].

--
Ticket URL: <https://code.djangoproject.com/ticket/28973#comment:3>

Django

unread,
Apr 20, 2018, 2:24:39 PM4/20/18
to django-...@googlegroups.com
#28973: Move the output of every file that collectstatic processes to verbosity
level 2
-------------------------------------+-------------------------------------
Reporter: Tanguy Nodet | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution:
Keywords: collecstatic | Triage Stage: Accepted
verbosity log logging management |
command |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/9890 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/28973#comment:4>

Django

unread,
Apr 23, 2018, 11:04:31 PM4/23/18
to django-...@googlegroups.com
#28973: Move the output of every file that collectstatic processes to verbosity
level 2
-------------------------------------+-------------------------------------
Reporter: Tanguy Nodet | Owner: nobody
Type: | Status: closed

Cleanup/optimization |
Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution: fixed

Keywords: collecstatic | Triage Stage: Accepted
verbosity log logging management |
command |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"3aae43d800a15db308cea0ea69729122c5c1d215" 3aae43d]:
{{{
#!CommitTicketReference repository=""
revision="3aae43d800a15db308cea0ea69729122c5c1d215"
Fixed #28973 -- Silenced copying/linking messages in collectstatic's
default verbosity.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28973#comment:5>

Reply all
Reply to author
Forward
0 new messages