All Questions
82 questions
1
vote
4
answers
333
views
Is it possible to turn off printing the id (hex address) globally for Python objects?
When you don't provide a __repr__ or __str__ method on a custom class, you just get a classname and the Python address of the object (or, to be more specific, what id(self) would return.
This is fine ...
0
votes
1
answer
58
views
How do I properly handle exceptions in Python without losing the traceback information?
I'm working on a Python application where I need to gracefully handle exceptions and log useful information for debugging purposes. Specifically, I want to catch exceptions that occur during runtime, ...
0
votes
2
answers
81
views
Make separate file output and behaivour depending on the logging level in python?
I'm trying to do something which seems a bit unorthodox but makes sense for me in a project I'm working on. I have seen a lot of questions that are asking similar or parts of my question but couldn't ...
0
votes
1
answer
262
views
How to enable logging for blpapi logs?
Currently I need to debug a market data subscription and I hope to obtain the blpapi logs to understand the transaction. Does anyone have an example to configure the logger and obtain blpapi logs ...
0
votes
1
answer
240
views
How to avoid execution AFTER set a minimal logging level with loguru?
I would like to use a different logging level in development than production environments. To do so, early in my program I set the minimal level for logs to be logged, as was answered to: How to set a ...
0
votes
1
answer
25
views
How to avoid LOGENTRIES_TOKEN spam logs in django?
When i run the python manage.py <somecmd>, i'm getting the below error:
It appears the LOGENTRIES_TOKEN parameter you entered is incorrect!
How can i disable this log, this log spamming across ...
1
vote
0
answers
51
views
low level of logging in python does not work
The question was solved by changing tz = get_localzone() to tz = pytz.utc
I am trying to do logging in Python. I need to swap the local time zone to the New York timezone. class CustomFormatter was ...
3
votes
1
answer
1k
views
How can I log sql queries in the SqlModel?
How could I see/log queries sent by sqlmodel to database.
0
votes
1
answer
44
views
Trying to Debug Dynamic Forms in Django - logging SQL
Context: I've recently taken on Web Development responsibilities at my job. I'm not 100% familiar with Django or our codebase yet.
Our staff intranet has dynamic forms for different accident reports. ...
0
votes
1
answer
38
views
Can't load properties from .ini into custom logger
I have a class called CustomLogger that is a subclass of BaseLogger, which is a subclass of logging.Logger. BaseLogger loads properties from a logger.ini file. So, CustomLogger is just a facade for ...
2
votes
2
answers
155
views
Convenient way to log each line of a function without cluttering the code in Python
Let´s say I have an annoying function which has a lot of if-elses in it and this function has a bug which occurs randomly.
I can not reproduce or debug it and I want to add some logging to see which ...
1
vote
1
answer
98
views
How can I include the caller in debug logging from Python constructors?
I have a class C which is instantiated all over the place in a large program. C.__init__() contains debug logging, giving the parameters passed in to the new instance.
It's often useful for these log ...
0
votes
1
answer
161
views
Multi-line variable logging Python
I have a Python (3.9.7) logging module that prints some of my variables over multiple lines. An example:
[ DEBUG] [SERVER_NAME] 2022-01-03 11:19:11,371 RMS re-projection error: 0.49781799970689544
[ ...
1
vote
0
answers
60
views
How to print to python console elapsed time every x seconds while a statement is executing?
I am running a clustering algorithm, and I want to see how long it has been running for with logging messages. Is there a way to log the elapsed time every minute for example, that will print out to ...
1
vote
0
answers
25
views
How to make python modules based sqlite3 print raw sqlite3 commands as debug messages? [duplicate]
I want to see what sqlite3 commands are called by modules based on the python sqlite3 module.
But I don't find a way to let the python sqlite3 module to do so. Would you please let me know whether ...