Customize astropy logger: timestamp, custom stack info
See original GitHub issueDescription
It would be very userful to provide the possibility to add the following features to astropy logger:
- A timestamp option;
- The possibility to extend/reduce stack info: now only the caller function is shown. Enabling or disabling called module, class and method/function would be useful
Example:
log.date=False
log.time=True
INFO: 17:06:41 > My Message [ my_module MyClass.my_method ] called by [my_test]
log.iso=True
log.verbose = 1
INFO: 2021-08-20T17:06:41 > My Message [my_test]
log.timestamp=False
log.verbose = 0
INFO: My Message
Additional context
This would be useful for astropy-based data reduction pipelines.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Python logging using custom timestamps (not current timestamp)
First, you need to create a log filter (filters have the ability to modify log records that pass through loggers they're attached to):...
Read more >Logging system — Astropy v5.2
Overview¶. The Astropy logging system is designed to give users flexibility in deciding which log messages to show, to capture them, and to...
Read more >cron jobs re-trigger when a new label is added #12063 - GitHub
Edit: Something similar happens with the Close? bot. ... Customize astropy logger: timestamp, custom stack info #12080.
Read more >top5relatedtags - Stack Exchange Data Explorer
Stack Overflow. Q&A for professional and enthusiast programmers. SELECT t1.TagName AS [Tag Link], t2.TagName AS [Tag Link], COUNT(pt1.
Read more >Python Examples of logging.setLoggerClass
INFO ) # Create handler for Report Portal. rp_handler = RPLogHandler(pytest.config. ... Force the logging system to use our custom logger class, then...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Probably, given they were written by the same person. 😆
Is the same trigger condition as the Extra CI label (#12063 )?