This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add microseconds to logging.LogRecord
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: arwade, jamescasbon, vinay.sajip
Priority: normal Keywords: patch

Created on 2022-01-07 14:11 by jamescasbon, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
usecs.patch jamescasbon, 2022-01-07 14:11
Messages (2)
msg409963 - (view) Author: James Casbon (jamescasbon) Date: 2022-01-07 14:11
LogRecord makes microseconds available via the msecs attribute.  This patch adds microseconds via usecs attribute.

Some regulators (eg MIFID II) require accuracy greater than 1ms in some industries.

This patch calls time_ns rather than time so that the usecs and msecs are calculated from int types and then gets the original ct attribute via division.
msg410011 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2022-01-07 19:24
Thanks for the patch. We're need to get contributors to sign a Contributor License Agreement (CLA) before we can accept their patches. Would you be willing to do this? The process could be smoother, but it's not too bad, and here's where you get started:

https://www.python.org/psf/contrib/contrib-form/
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90450
2022-01-12 15:23:32arwadesetnosy: + arwade
2022-01-07 19:24:07vinay.sajipsetmessages: + msg410011
2022-01-07 17:30:02vinay.sajipsetversions: + Python 3.11
2022-01-07 16:18:21ned.deilysetnosy: + vinay.sajip
2022-01-07 14:12:25jamescasbonsettype: enhancement
components: + Library (Lib)
2022-01-07 14:11:50jamescasboncreate