Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug.log in backend code #3

Open
PgLoLo opened this issue Nov 13, 2020 · 2 comments
Open

Debug.log in backend code #3

PgLoLo opened this issue Nov 13, 2020 · 2 comments

Comments

@PgLoLo
Copy link

PgLoLo commented Nov 13, 2020

Is it possible to see the Debug.log output in the backend side? In frontend Debug.log works as usual, but in the backend side I couldn't find where I can see the output.

@Viir
Copy link
Member

Viir commented Nov 13, 2020

There is no implementation so far to collect or forward what goes into Debug.log in the backend.
Currently, the backend uses a javascript engine to run the Elm code. As long as we use the javascript engine way, I think it should be possible to add a javascript method that collects the logged values and then get them out after each event/msg. Also, the javascript engine could already have an API to forward from console.log.

Currently, there is this code to ensure log statements in the javascript don't crash the app: https://github.com/elm-fullstack/elm-fullstack/blob/c29fbe5b433aff7d5cd133e7f8e529133a5394ba/implement/PersistentProcess/PersistentProcess.Common/Process.cs#L393-L409

I also found a related example of logging implementations: https://discourse.elm-lang.org/t/i-successfully-ran-an-elm-worker-from-python/5451/2?u=viir

@Viir
Copy link
Member

Viir commented Aug 18, 2021

Now that more of the infrastructure is in place, I don't expect any significant challenge for collecting the log entries from the backend app.
An open question remaining is how should the interface to read the log entries look like.
At the moment, I guess you'd present the log entries as part of the function application they resulted from. In an inspection view, you might have a list of function applications to present the state thread. When expanding the representation of a history step, the log entries would appear under that history step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants