Skip to content

printandlog

bchate edited this page Oct 18, 2018 · 3 revisions

There is no way (at the time of writing this script) to re-open an updated version of a closed Jupyter script. Which does not allow the user to evaluate the progression of the running workflow once the dedicated page closed. The printandlog function, try to solve this issue, by printing and logging specific messages at the same time. Then even if the printed information is not anymore available, the user has access anytime to the updated log.

The function has two options:

  • message: Message to print and log
  • reset: Reset the existing log if True, or append to existing log if False (default)
  • logname: Name of the logfile. It is strongly advised to defined it once in the configuration section

If you have credentials for the Swiss Data Cube, you can play with a demo script at

http://calc.unepgrid.ch:8080/notebooks/demo_FUN_printandlog.ipynb

or

http://sdc.unepgrid.ch:8080/notebooks/demo_FUN_printandlog.ipynb

The code and the demo jupyter notebook script can be found here

Clone this wiki locally