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

Rethink logging #235

Open
tlienart opened this issue Jul 18, 2023 · 3 comments
Open

Rethink logging #235

tlienart opened this issue Jul 18, 2023 · 3 comments
Labels

Comments

@tlienart
Copy link
Owner

  • Different levels
  • warnings that should be shown in the REPL
  • (errors) should ideally not happen
  • things shown in the browser
  • formatting of information messages should be streamlined so it's clear what caused it, what the user should do about it
@tlienart
Copy link
Owner Author

JuliaLogging almost certainly has stuff you can draw from but, most likely, you'll need to do things a bit differently

Some stuff to note:

  • there's a level of logging in the repl which the user should be able to filter completely
  • there's a level of logging in the browser which the user should not be able to disable
  • the logging should not affect whatever is done within cells
  • cell errors should not cause server crashes; the page should just be skipped and replaced by an error page.

@tlienart
Copy link
Owner Author

Can use TerminalLoggers

@tlienart
Copy link
Owner Author

tlienart commented Jul 24, 2023

location logging (done with FranklinParser issues) should be done with block failures as well.

Probably the right way to go here is to have dedicated logic to handle errors.

IN = (context, trigger, ...)

  • context: either global (if in config / utils) or local if page
  • trigger: the block / area that triggered, should have a parent_string that we can get location in file from
  • ...

OUT =

  • updated context to indicate either that it has (possibly how many errors it has)
  • a styled warning in the REPL (potentially in stdout to avoid messing with stderr which is already severely abused, potentially use printstyled, avoid using @warn since it would indicate spurious information such as which line of code threw the warning which is not useful
  • an injected banner
  • ...

Should also list out every possible way that Xranklin can choke on something and what to do about it:

  • start in bad directory (remove __site if xranklin is started in wrong folder #237)
  • parser exception (should be handled by FranklinParser)
  • problematic hfun / def
  • problematic lxfun / lxcommand
  • error in var cell (see below)
  • error in code cell (should be already handled by IOCapture but maybe we want to adjust the msg in console)
  • wrong cache loading (should not happen)
  • ...

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

No branches or pull requests

1 participant