Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable the RichHandler log handler? #3292

Open
3 tasks done
cpitclaudel opened this issue Mar 12, 2024 · 0 comments · May be fixed by #3293
Open
3 tasks done

Option to disable the RichHandler log handler? #3292

cpitclaudel opened this issue Mar 12, 2024 · 0 comments · May be fixed by #3293

Comments

@cpitclaudel
Copy link

  • I have searched the issues (including closed ones) and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.
  • I am willing to lend a hand to help implement this feature.

Feature Request

The default logging format introduces aggressive line wraps. For example:

[11:03:07] ERROR    Could not process                          generators.py:871
                    pages/xxxxx/xxxxxxxxxxx/xxxxxxxxxxx.rst                     
                    /home/cpitclaudel/git/xxxxxxx/xxx/xxx/page                  
                    s/xxxxx/xxxxxxxxxxx/xxxxxxxxxxx.rst:74:                     
                    (ERROR/2) …

Unfortunately, my editor is not smart enough to undo the line breaks, so it offers to open s/xxxxx/xxxxxxxxxxx/xxxxxxxxxxx.rst:74 instead.

I would love an option to just print the error using a less-fancy log handler. The default format is pretty OK:

Could not process pages/xxxxx/xxxxxxxxxxx/xxxxxxxxxxx.rst
/home/cpitclaudel/git/xxxxxxx/xxx/xxx/pages/pages/xxxxx/xxxxxxxxxxx/xxxxxxxxxxx.rst:74: (WARNING/2) …
cpitclaudel pushed a commit to cpitclaudel/pelican that referenced this issue Mar 12, 2024
* pelican/__init__.py (parse_arguments): Declare new --logs-handler argument.
Uses a string instead of a `type=` argument to get better error messages when
passed an incorrect choice.
(main): Pass `args.logs_handler` to `init_logging`
* pelican/log.py: Expose default log handler as `DEFAULT_LOG_HANDLER`.
(init): Pass handler to `logging.basicConfig`.

Closes getpelicanGH-3292.
cpitclaudel pushed a commit to cpitclaudel/pelican that referenced this issue Mar 12, 2024
* pelican/__init__.py (parse_arguments): Declare new --logs-handler argument.
Uses a string instead of a `type=` argument to get better error messages when
passed an incorrect choice.
(main): Pass `args.logs_handler` to `init_logging`
* pelican/log.py: Expose default log handler as `DEFAULT_LOG_HANDLER`.
(init): Pass handler to `logging.basicConfig`.

Closes getpelicanGH-3292.
@cpitclaudel cpitclaudel linked a pull request Mar 12, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant