Why is the logger being deactivated when the APDL solver is triggered?

Naveen Kumar Begari
Naveen Kumar Begari Member Posts: 77
10 Comments 5 Likes First Answer First Anniversary
**

Hi Team,

I was working with the logging module, and I've noticed that when the analysis is running, the logger disconnects. Once the solving process is complete, it automatically reconnects.

Is there any solution to handle this issue?

Comments

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee, GitHub-issue-creator Posts: 347
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    Hi @Naveen Kumar Begari Could you please provide a simple code example to demonstrate this issue?

  • Naveen Kumar Begari
    Naveen Kumar Begari Member Posts: 77
    10 Comments 5 Likes First Answer First Anniversary
    **

    Hello @Landon Mitchell Kanner , I have sent the script internally

  • Naveen Kumar Begari
    Naveen Kumar Begari Member Posts: 77
    10 Comments 5 Likes First Answer First Anniversary
    **
    edited February 7
    async def solve_structural_analysis():
        try:
            logger.debug("Solving Structural Analysis...")
            asyncio.to_thread(solution.Solve(True))
            logger.debug("Solved Structural Analysis...")
        except Exception as e:
            logger.error(f"An error occurred while solving the analysis: {e}")
    # Running the async function
    asyncio.run(solve_structural_analysis())
    

    Here is the script, "The logger shows nothing during the analysis, and only starts logging again once the solution process is complete.

    @James Derrick It would be very helpful for your guidance

    Thanks
    Naveen Kumar

  • Naveen Kumar Begari
    Naveen Kumar Begari Member Posts: 77
    10 Comments 5 Likes First Answer First Anniversary
    **

    Please consider this script: @AKD-Scripting-Team

     
    async def solve_structural_analysis():
    try:
    logger.debug("Solving Structural Analysis...")
            asyncio.to_thread(solution.Solve(True))
            logger.debug("Solved Structural Analysis...")
    except Exception as e:
            logger.error(f"An error occurred while solving the analysis: {e}")
    
    #Running the async function
    asyncio.run(solve_structural_analysis())