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

Standard fields not accepted in logging format strings #63

Open
freddrake opened this issue Dec 27, 2018 · 2 comments
Open

Standard fields not accepted in logging format strings #63

freddrake opened this issue Dec 27, 2018 · 2 comments

Comments

@freddrake
Copy link
Contributor

The process, processName, thread, and threadName fields are not currently considered valid by ZConfig.

These may, individually, be None or a value of the appropriate type, depending on the values of globals in the logging module.

This is at least tangentially related to #53, but may require special consideration given the relation to the logging.logThreads and logging.logMultiprocessing settings.

@freddrake
Copy link
Contributor Author

funcName is another that's been omitted; it wasn't around when ZConfig was written, but has been since Python 2.6.

That one should be very safe to add a string sample value; it appears to always be present as a string, even though it might be an uninformative '(unknown function)' at times.

@freddrake
Copy link
Contributor Author

All of these fields are actually present when configuring a formatter using the defined sections, so validation of the fields works as expected, with the default settings of logging.logMultiprocessing and logging.logThreads.

The old validation function for format strings does not support these, though the updates to reflect proper types for other fields affect it as well.

freddrake added a commit that referenced this issue Jan 2, 2019
- field added to log records in Python 2.6 and 3.1,
  so accepted for all python versions supported by
  ZConfig

- added tests specifically for the log_format function
  accepting "funcName" and numeric formatting for
  other fields recently touched in ZConfig

partially addresses issue #63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant