How to display the terminal information on the dash web

Hello everyone, I would like to display the hints of each steps on the dash web, which is successful with “print” in the terminal. What can I do for displaying them in the real time on the webpage? Or can I insert directly the interface of the terminal on the site?
Thx so much for your help.

import dash_bootstrap_components as dbc
from dash import Input, Output, State, html

alert = html.Div(
    [
        dbc.Button(
            "Toggle", id="alert-toggle-auto", className="me-1", n_clicks=0
        ),
        html.Hr(),
        dbc.Alert(
            "Hello! I am an auto-dismissing alert!",
            id="alert-auto",
            is_open=True,
            duration=4000,
        ),
    ]
)


@app.callback(
    Output("alert-auto", "is_open"),
    [Input("alert-toggle-auto", "n_clicks")],
    [State("alert-auto", "is_open")],
)
def toggle_alert(n, is_open):
    if n:
        return not is_open
    return is_open

Maybe you could try dbc.Alert().

2 Likes

The accepted answer is not actually responding to the question. I have found the DashLogger utility, but it is still not useful for my application as the process of logging messages from external functions (not inside the callback) is very complicated. Any other suggestions/insights?