question

Upvotes
Accepted
31 7 7 17

How can I set log details in the Python Data Library in code?

Hi all, I know it's possible to set logs to show up in my Python's code's output via "logs" in the configuration file, but I was wondering,is there a way to do it in line?

e.g.:

rd.open_session(logs = {
        "level": "debug",
        "transports": {
            "console": {
                "enabled": false},
            "file": {
                "enabled": false,
                "name": "refinitiv-data-lib.log"}}})
pythonpython apitroubleshooting
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
5k 16 2 7

Hi @danieluphromes ,


You can use the following code:

rd.get_config().set_param(
    param=f"logs.transports.console.enabled", value=True
)
session = rd.open_session()
session.set_log_level("DEBUG")

Is this something you were looking for?


best regards,

Haykaz

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.