Edgewall Software

Opened 4 years ago

Last modified 3 years ago

#13121 closed defect

"Error: Invalid log level" when switching Logging Type to None in Admin panel — at Initial Version

Reported by: oliver.joos@… Owned by:
Priority: normal Milestone: 1.2.4
Component: admin/web Version: 1.2.3
Severity: major Keywords:
Cc: oliver.joos@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

How?

If I go to Admin / Logging and choose Type "File" and "Apply changes" it works as expected and says "Your changes have been saved". But if I choose Type "None" again and "Apply changes" then and error page shows with "Unknown log level None" in a red box.

Where?

I see this bug in trac-1.2.3, installed with pip of Python 2.7.9 on an up-to-date Raspbian Stretch.

And I can reproduce this bug on a fresh ISO-DVD of Linux Mint 19.0 (Python 2.7.15) and a Trac built from source of rjollos.git branch "pull_de_from_transifex" (I guess one of the latest rc of upcoming 1.2.4)

Workaround

As root I edit trac.ini manually. But without access to trac.ini one could leave Type as-is and switch Level to CRITICAL to mute Logging.

Solution

I think this bug should not be fixed in the page code, but here:

https://trac.edgewall.org/browser/tags/trac-1.2.3/trac/admin/web_ui.py#L288

I would change this line into:

new_level = req.args.get('log_level') or log_level

Change History (0)

Note: See TracTickets for help on using tickets.