polyfemos.util.messenger

Functions for printing and debugging

copyright

2019, University of Oulu, Sodankyla Geophysical Observatory

license

GNU Lesser General Public License v3.0 or later (https://spdx.org/licenses/LGPL-3.0-or-later.html)

Public Functions

polyfemos.util.messenger.debugger(func_)[source]

A decorator for monitoring function calls and returns

Parameters

func_ (func) –

Return type

func

Returns

polyfemos.util.messenger.messenger(msg, option, showpid=True, quiet=False, quit_if_error=True)[source]

Every print command around the program should be called using this function.

Parameters
  • msg (str) – The message to be printed

  • option (str) – Choose a string the msg will start with

  • showpid (bool, optional) – defaults to True, useful if multiprocessing is used, Shows the PID of the process outputting the msg

  • quiet (bool, optional) – defaults to False, if True prints only error messages

  • quit_if_error (bool, optional) – defaults to True, program execution is terminated if error occurs