diff options
| -rw-r--r-- | pyisda/logging.pyx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pyisda/logging.pyx b/pyisda/logging.pyx index 5aa5282..2f94d16 100644 --- a/pyisda/logging.pyx +++ b/pyisda/logging.pyx @@ -1,10 +1,19 @@ +""" helper functions to use the logging facility""" + def enable_logging(): + """turn on logging + + default location is error.log in the $HOME directory. + To change from default use ``set_logging_file`` + """ JpmcdsErrMsgOn() def disable_logging(): + """turn off logging""" JpmcdsErrMsgOff() def set_logging_file(str file_name, TBoolean append = True): + """set logging file""" filename_bytes = file_name.encode('utf-8') cdef char* c_string = filename_bytes if JpmcdsErrMsgFileName(c_string, append) !=0: @@ -16,5 +25,5 @@ def log_message(str msg): JpmcdsErrLogWrite(c_msg) def flush(): - if JpmcdsErrMsgFlush() !=0: + if JpmcdsErrMsgFlush() != 0: raise |
