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"}}})

Best Answer

  • aramyan.h
    Answer ✓

    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