question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Customize astropy logger: timestamp, custom stack info

See original GitHub issue

Description

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:closed
  • Created 2 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pllimcommented, Aug 18, 2021

Probably, given they were written by the same person. 😆

0reactions
nstarmancommented, Aug 18, 2021

Is the same trigger condition as the Extra CI label (#12063 )?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found