
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
support sub-second granularity/precision in `--log-date-format` (strftime `%f`) Β· Issue #10991 Β· pytest-dev/pytest
Description:
tl;dr pytest processing strftime %f specifier from --log-*-date-format arguments would allow me to accurately merge log messages from disparate sub-systems What's the problem? Tests I run have ...
Website Age:
17 years and 8 months (reg. 2007-10-09).
Matching Content Categories {π}
- Technology & Computing
- Dating & Relationships
- Health & Fitness
Content Management System {π}
What CMS is github.com built with?
Github.com employs WORDPRESS.
Traffic Estimate {π}
What is the average monthly size of github.com audience?
ππ Tremendous Traffic: 10M - 20M visitors per month
Based on our best estimate, this website will receive around 10,000,019 visitors per month in the current month.
However, some sources were not loaded, we suggest to reload the page to get complete results.
check SE Ranking
check Ahrefs
check Similarweb
check Ubersuggest
check Semrush
How Does Github.com Make Money? {πΈ}
Subscription Packages {π³}
We've located a dedicated page on github.com that might include details about subscription plans or recurring payments. We identified it based on the word pricing in one of its internal links. Below, you'll find additional estimates for its monthly recurring revenues.How Much Does Github.com Make? {π°}
Subscription Packages {π³}
Prices on github.com are in US Dollars ($).
They range from $4.00/month to $21.00/month.
We estimate that the site has approximately 4,989,889 paying customers.
The estimated monthly recurring revenue (MRR) is $20,957,532.
The estimated annual recurring revenues (ARR) are $251,490,385.
Wordpress Themes and Plugins {π¨}
What WordPress theme does this site use?
It is strange but we were not able to detect any theme on the page.
What WordPress plugins does this website use?
It is strange but we were not able to detect any plugins on the page.
Keywords {π}
pytest, log, messages, strftime, subsecond, issue, logdateformat, support, frobulator, logging, testlogger, granularityprecision, config, jtmoon, file, system, sign, pytestdev, specifier, stopping, error, testmainpy, added, type, related, plugin, theirix, projects, closed, print, granularity, datetimestamps, precision, starting, device, logclidateformat, python, feature, commit, references, handle, microseconds, custom, loggingformatter, verified, nicoddemus, navigation, solutions, code, issues,
Topics {βοΈ}
log--date-format arguments log-cli-date-format engineers investigating issues log-file-date-format issue easy issue complex testing system log-cli-format activity jtmoon79 changed log-date-format log-date-format= `--log-date-format` -date-format options pytest log messages personal information support natural ordering mechanism comment metadata assignees assigned labels good features branch type log file messages system log messages alternative solutions verified 4da9026 sign type projects config file type manipulate log datetimestamps command-line run bowling pins 2023-05-11t13 pytest feature request projects milestone date-format logging format log messages log file contributor plugin logging related custom logging handle microseconds prokulator 2023-05-11t13 system components support strftime % logger = logging pytest print millisecond precision config related config handling 34 device error python strftime % error 20230511t180748 precisely ordered current confusion
Payment Methods {π}
- Braintree
Questions {β}
- Already have an account?
- What's the problem?
Schema {πΊοΈ}
DiscussionForumPosting:
context:https://schema.org
headline:support sub-second granularity/precision in `--log-date-format` (strftime `%f`)
articleBody:***tl;dr*** pytest processing strftime `%f` specifier from `--log-*-date-format` arguments would allow me to accurately merge log messages from disparate sub-systems
### What's the problem?
Tests I run have pytest log messages that print at the second granularity for the datetimestamp, e.g. `2023-05-11T13:45:34`. At the same time, other log file messages not generated by pytest print sub-second datetimestamps, e.g. `2023-05-11T13:45:34.123`.
When reviewing the various logs, there are many message from other system components that are printing many log messages per second. Because pytest log messages are lacking sub-second precision, I am unable to align pytest log messages within other system log messages.
#### contrived example
For example, the system-under-test generates a log file like:
```text
2023-05-11T13:45:34.001 starting the frobulator
2023-05-11T13:45:34.100 wiggling the waggulator
2023-05-11T13:45:34.200 stopping the frobulator
2023-05-11T13:45:34.301 starting the frobulator
2023-05-11T13:45:34.400 poking the prokulator
2023-05-11T13:45:34.450 prokulator response ERROR_NOT_ONLINE
2023-05-11T13:45:34.500 stopping the frobulator
2023-05-11T13:45:34.600 starting the frobulator
2023-05-11T13:45:34.700 juggling some bowling pins
2023-05-11T13:45:34.750 DROPPED A PIN!
2023-05-11T13:45:34.800 stopping the frobulator
2023-05-11T13:45:34.839 ERROR 0x0F009001 STOPPING THE frobulator
```
and the driver of tests, pytest, generates a log file like:
```text
2023-05-11T13:45:34 checking device
2023-05-11T13:45:34 ping device
2023-05-11T13:45:34 device error!
```
The pytest log messages cannot be precisely ordered among the other log messages that occurred during the datetime second `2023-05-11T13:45:34`, there were many things that occurred in the other system components within that second.
#### current confusion
Given the following pytest code
```Python
import logging
import pytest
logging.basicConfig()
logger = logging.getLogger(__name__)
def test_logger():
logger.error("test_logger()ERROR")
logger.warning("test_logger()WARNING")
```
To add sub-second granularity, it seems sensible to add `%f` within the `--log-cli-date-format`
```text
$ python -m pytest \
-v -v \
--log-cli-date-format="%Y%m%dT%H%M%S.%f" \
--capture=tee-sys \
-k "test_logger"
```
but then I see the confusing output of
```text
20230511T181007.%f: ERROR : [test_main.py:27 - test_logger()] : test_logger()ERROR
20230511T181007.%f: WARNING : [test_main.py:28 - test_logger()] : test_logger()WARNING
```
pytest logging is ignoring the strftime `%f` specifier!
---
### pytest feature request
I want pytest log messages to print sub-second granularity, e.g. process strftime `%f` within `--log-date-format="...%f..."` settings.
#### Describe the solution you'd like
<!-- A clear and concise description of what you want to happen. -->
Support strftime `%f` specifier in the various settings for _date-format_, e.g. `--log-date-format`, `--log-cli-date-format`, `--log-file-date-format`.
<!-- Provide examples of real-world use cases that this would enable and how it solves the problem described above. -->
In my complex testing system, this means _all_ log messages would be printed to millisecond precision. This allows engineers investigating issues to more accurately merge disparate testing system logs by their natural ordering mechanism of a datetimestamp.
---
### Alternative Solutions
<!-- Have you tried to workaround the problem using a pytest plugin or other tools? Or a different approach to solving this issue? Please elaborate here. -->
I can set the `logging` format to include `%(msecs)03d`.
However, it's a little confusing to have to manipulate log datetimestamps by two different mechanisms, `--log-cli-format` and `--log-cli-date-format`.
#### example workaround
On the command-line run:
```text
$ python -m pytest \
-v -v \
--log-cli-date-format="%Y%m%dT%H%M%S." \
--log-cli-format="%(asctime)s%(msecs)03d: %(levelname)s : [%(filename)s:%(lineno)s - %(funcName)s()] : %(message)s" \
--capture=tee-sys \
-k "test_logger"
```
This prints datetimestamps with millisecond precision
```text
20230511T180748.192: ERROR : [test_main.py:27 - test_logger()] : test_logger()ERROR
20230511T180748.195: WARNING : [test_main.py:28 - test_logger()] : test_logger()WARNING
```
<br />
### Summary
It is more intuitive for pytest to process the Python strftime `%f` specifier within all `--*-date-format` options.
author:
url:https://github.com/jtmoon79
type:Person
name:jtmoon79
datePublished:2023-05-12T00:59:31.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:1
url:https://github.com/10991/pytest/issues/10991
context:https://schema.org
headline:support sub-second granularity/precision in `--log-date-format` (strftime `%f`)
articleBody:***tl;dr*** pytest processing strftime `%f` specifier from `--log-*-date-format` arguments would allow me to accurately merge log messages from disparate sub-systems
### What's the problem?
Tests I run have pytest log messages that print at the second granularity for the datetimestamp, e.g. `2023-05-11T13:45:34`. At the same time, other log file messages not generated by pytest print sub-second datetimestamps, e.g. `2023-05-11T13:45:34.123`.
When reviewing the various logs, there are many message from other system components that are printing many log messages per second. Because pytest log messages are lacking sub-second precision, I am unable to align pytest log messages within other system log messages.
#### contrived example
For example, the system-under-test generates a log file like:
```text
2023-05-11T13:45:34.001 starting the frobulator
2023-05-11T13:45:34.100 wiggling the waggulator
2023-05-11T13:45:34.200 stopping the frobulator
2023-05-11T13:45:34.301 starting the frobulator
2023-05-11T13:45:34.400 poking the prokulator
2023-05-11T13:45:34.450 prokulator response ERROR_NOT_ONLINE
2023-05-11T13:45:34.500 stopping the frobulator
2023-05-11T13:45:34.600 starting the frobulator
2023-05-11T13:45:34.700 juggling some bowling pins
2023-05-11T13:45:34.750 DROPPED A PIN!
2023-05-11T13:45:34.800 stopping the frobulator
2023-05-11T13:45:34.839 ERROR 0x0F009001 STOPPING THE frobulator
```
and the driver of tests, pytest, generates a log file like:
```text
2023-05-11T13:45:34 checking device
2023-05-11T13:45:34 ping device
2023-05-11T13:45:34 device error!
```
The pytest log messages cannot be precisely ordered among the other log messages that occurred during the datetime second `2023-05-11T13:45:34`, there were many things that occurred in the other system components within that second.
#### current confusion
Given the following pytest code
```Python
import logging
import pytest
logging.basicConfig()
logger = logging.getLogger(__name__)
def test_logger():
logger.error("test_logger()ERROR")
logger.warning("test_logger()WARNING")
```
To add sub-second granularity, it seems sensible to add `%f` within the `--log-cli-date-format`
```text
$ python -m pytest \
-v -v \
--log-cli-date-format="%Y%m%dT%H%M%S.%f" \
--capture=tee-sys \
-k "test_logger"
```
but then I see the confusing output of
```text
20230511T181007.%f: ERROR : [test_main.py:27 - test_logger()] : test_logger()ERROR
20230511T181007.%f: WARNING : [test_main.py:28 - test_logger()] : test_logger()WARNING
```
pytest logging is ignoring the strftime `%f` specifier!
---
### pytest feature request
I want pytest log messages to print sub-second granularity, e.g. process strftime `%f` within `--log-date-format="...%f..."` settings.
#### Describe the solution you'd like
<!-- A clear and concise description of what you want to happen. -->
Support strftime `%f` specifier in the various settings for _date-format_, e.g. `--log-date-format`, `--log-cli-date-format`, `--log-file-date-format`.
<!-- Provide examples of real-world use cases that this would enable and how it solves the problem described above. -->
In my complex testing system, this means _all_ log messages would be printed to millisecond precision. This allows engineers investigating issues to more accurately merge disparate testing system logs by their natural ordering mechanism of a datetimestamp.
---
### Alternative Solutions
<!-- Have you tried to workaround the problem using a pytest plugin or other tools? Or a different approach to solving this issue? Please elaborate here. -->
I can set the `logging` format to include `%(msecs)03d`.
However, it's a little confusing to have to manipulate log datetimestamps by two different mechanisms, `--log-cli-format` and `--log-cli-date-format`.
#### example workaround
On the command-line run:
```text
$ python -m pytest \
-v -v \
--log-cli-date-format="%Y%m%dT%H%M%S." \
--log-cli-format="%(asctime)s%(msecs)03d: %(levelname)s : [%(filename)s:%(lineno)s - %(funcName)s()] : %(message)s" \
--capture=tee-sys \
-k "test_logger"
```
This prints datetimestamps with millisecond precision
```text
20230511T180748.192: ERROR : [test_main.py:27 - test_logger()] : test_logger()ERROR
20230511T180748.195: WARNING : [test_main.py:28 - test_logger()] : test_logger()WARNING
```
<br />
### Summary
It is more intuitive for pytest to process the Python strftime `%f` specifier within all `--*-date-format` options.
author:
url:https://github.com/jtmoon79
type:Person
name:jtmoon79
datePublished:2023-05-12T00:59:31.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:1
url:https://github.com/10991/pytest/issues/10991
Person:
url:https://github.com/jtmoon79
name:jtmoon79
url:https://github.com/jtmoon79
name:jtmoon79
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:1
interactionType:https://schema.org/CommentAction
userInteractionCount:1
External Links {π}(2)
Analytics and Tracking {π}
- Site Verification - Google
Libraries {π}
- Clipboard.js
- D3.js
- Lodash
Emails and Hosting {βοΈ}
Mail Servers:
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- alt2.aspmx.l.google.com
- alt3.aspmx.l.google.com
- alt4.aspmx.l.google.com
Name Servers:
- dns1.p08.nsone.net
- dns2.p08.nsone.net
- dns3.p08.nsone.net
- dns4.p08.nsone.net
- ns-1283.awsdns-32.org
- ns-1707.awsdns-21.co.uk
- ns-421.awsdns-52.com
- ns-520.awsdns-01.net