When importing pyCloudy, a special object is instantiated to hold messages (error, warnings, normal messages and debug tools).
This object is named pc.log_ (considering that pyCloudy is imported as pc). The object is receiving messages, writing them in the standard output (and eventually in a file) and also keeping them in memory. It can also stop the execution and raise an error when error message is sent to it. It also keep the information of which part of the code send the message (the calling), and the time at which is was sent.
There is a level of verbosity, that can be changed at any moment (e.g. pc.log_.level = 2), which determine the kind of messages that will be printed to the standard output (commonly the screen).
There are 5 types of messages this object is managing:
It is possible to store the messages in a file. The file if open with pc.log_.open_file('my_log.txt'), and eventually closed by pc.log_.close_file().
Access to the messages is possible with pc.log_.print_messages(), pc.log_.print_warnings() and pc.log_.print_errors().