-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #714 from MridulS/log_consindshock
[wip] logging in ConsIndShockModel
- Loading branch information
Showing
4 changed files
with
211 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,40 @@ | ||
from .core import * | ||
|
||
__version__ = "0.10.6" | ||
|
||
''' | ||
Logging tools for HARK. | ||
The logger will print logged statements to STDOUT by default. | ||
The logger wil use an informative value by default. | ||
The user can set it to "verbose" to get more information, or "quiet" to supress informative messages. | ||
''' | ||
|
||
import logging | ||
|
||
logging.basicConfig( | ||
format="%(message)s" | ||
) | ||
|
||
_log = logging.getLogger("HARK") | ||
|
||
_log.setLevel(logging.ERROR) | ||
|
||
def disable_logging(): | ||
_log.disabled = True | ||
|
||
def enable_logging(): | ||
_log.disabled = False | ||
|
||
def warnings(): | ||
_log.setLevel(logging.WARNING) | ||
|
||
def quiet(): | ||
_log.setLevel(logging.ERROR) | ||
|
||
def verbose(): | ||
_log.setLevel(logging.INFO) | ||
|
||
def set_verbosity_level(level): | ||
_log.setLevel(level) |
Oops, something went wrong.