-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update header file and documentation
- Loading branch information
1 parent
84c1308
commit a7d8d83
Showing
8 changed files
with
172 additions
and
110 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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,17 +1,46 @@ | ||
/* This code is governed by the MIT license. See LICENSE for details. */ | ||
/* The lines below have little spacing to ease the line-length requirement */ | ||
/* There is no conflict with the fortran intrinsic log because that only has one argument */ | ||
#define log(level,format) if(logp(level))write(logu,format)trim(logl(level,__FILE__,__LINE__))//" ", | ||
#define log_fatal(format) if(logp(LOG_FATAL))write(logu,format)trim(logl(LOG_FATAL,__FILE__,__LINE__))//" ", | ||
#define log_error(format) if(logp(LOG_ERROR))write(logu,format)trim(logl(LOG_ERROR,__FILE__,__LINE__))//" ", | ||
#define log_warn(format) if(logp(LOG_WARN))write(logu,format)trim(logl(LOG_WARN,__FILE__,__LINE__))//" ", | ||
#define log_info(format) if(logp(LOG_INFO))write(logu,format)trim(logl(LOG_INFO,__FILE__,__LINE__))//" ", | ||
#define log_debug(format) if(logp(LOG_DEBUG))write(logu,format)trim(logl(LOG_DEBUG,__FILE__,__LINE__))//" ", | ||
#define log_trace(format) if(logp(LOG_TRACE))write(logu,format)trim(logl(LOG_TRACE,__FILE__,__LINE__))//" ", | ||
#define log_root(level,format) if(logp(level,0))write(logu,format)trim(logl(level,__FILE__,__LINE__))//" ", | ||
#define log_root_fatal(format) if(logp(LOG_FATAL,0))write(logu,format)trim(logl(LOG_FATAL,__FILE__,__LINE__))//" ", | ||
#define log_root_error(format) if(logp(LOG_ERROR,0))write(logu,format)trim(logl(LOG_ERROR,__FILE__,__LINE__))//" ", | ||
#define log_root_warn(format) if(logp(LOG_WARN,0))write(logu,format)trim(logl(LOG_WARN,__FILE__,__LINE__))//" ", | ||
#define log_root_info(format) if(logp(LOG_INFO,0))write(logu,format)trim(logl(LOG_INFO,__FILE__,__LINE__))//" ", | ||
#define log_root_debug(format) if(logp(LOG_DEBUG,0))write(logu,format)trim(logl(LOG_DEBUG,__FILE__,__LINE__))//" ", | ||
#define log_root_trace(format) if(logp(LOG_TRACE,0))write(logu,format)trim(logl(LOG_TRACE,__FILE__,__LINE__))//" ", | ||
|
||
/* Log level constants */ | ||
#define LOG_LEVEL_FATAL_DEF 1 | ||
#define LOG_LEVEL_ERROR_DEF 2 | ||
#define LOG_LEVEL_WARN_DEF 3 | ||
#define LOG_LEVEL_INFO_DEF 4 | ||
#define LOG_LEVEL_DEBUG_DEF 5 | ||
#define LOG_LEVEL_TRACE_DEF 6 | ||
|
||
/* The lines below have little spacing to ease the fortran line-length requirement */ | ||
#define log_fatal(format) if(logp(LOG_LEVEL_FATAL_DEF))write(logu,format)trim(logl(LOG_LEVEL_FATAL_DEF,__FILE__,__LINE__))//" ", | ||
#define log_error(format) if(logp(LOG_LEVEL_ERROR_DEF))write(logu,format)trim(logl(LOG_LEVEL_ERROR_DEF,__FILE__,__LINE__))//" ", | ||
#define log_warn(format) if(logp(LOG_LEVEL_WARN_DEF))write(logu,format)trim(logl(LOG_LEVEL_WARN_DEF,__FILE__,__LINE__))//" ", | ||
#define log_info(format) if(logp(LOG_LEVEL_INFO_DEF))write(logu,format)trim(logl(LOG_LEVEL_INFO_DEF,__FILE__,__LINE__))//" ", | ||
|
||
#ifdef DISABLE_LOG_DEBUG | ||
#define log_debug(format) if(.false.)write(logu,format)trim(logl(LOG_LEVEL_DEBUG_DEF,__FILE__,__LINE__))//" ", | ||
#else | ||
#define log_debug(format) if(logp(LOG_LEVEL_DEBUG_DEF))write(logu,format)trim(logl(LOG_LEVEL_DEBUG_DEF,__FILE__,__LINE__))//" ", | ||
#endif | ||
|
||
#ifdef ENABLE_LOG_TRACE | ||
#define log_trace(format) if(logp(LOG_LEVEL_TRACE_DEF))write(logu,format)trim(logl(LOG_LEVEL_TRACE_DEF,__FILE__,__LINE__))//" ", | ||
#else | ||
#define log_trace(format) if(.false.)write(logu,format)trim(logl(LOG_LEVEL_TRACE_DEF,__FILE__,__LINE__))//" ", | ||
#endif | ||
|
||
|
||
|
||
#define log_root_fatal(format) if(logp(LOG_LEVEL_FATAL_DEF,0))write(logu,format)trim(logl(LOG_LEVEL_FATAL_DEF,__FILE__,__LINE__))//" ", | ||
#define log_root_error(format) if(logp(LOG_LEVEL_ERROR_DEF,0))write(logu,format)trim(logl(LOG_LEVEL_ERROR_DEF,__FILE__,__LINE__))//" ", | ||
#define log_root_warn(format) if(logp(LOG_LEVEL_WARN_DEF,0))write(logu,format)trim(logl(LOG_LEVEL_WARN_DEF,__FILE__,__LINE__))//" ", | ||
#define log_root_info(format) if(logp(LOG_LEVEL_INFO_DEF,0))write(logu,format)trim(logl(LOG_LEVEL_INFO_DEF,__FILE__,__LINE__))//" ", | ||
|
||
#ifdef DISABLE_LOG_DEBUG | ||
#define log_root_debug(format) if(.false.)write(logu,format)trim(logl(LOG_LEVEL_DEBUG_DEF,__FILE__,__LINE__))//" ", | ||
#else | ||
#define log_root_debug(format) if(logp(LOG_LEVEL_DEBUG_DEF,0))write(logu,format)trim(logl(LOG_LEVEL_DEBUG_DEF,__FILE__,__LINE__))//" ", | ||
#endif | ||
|
||
#ifdef ENABLE_LOG_TRACE | ||
#define log_root_trace(format) if(logp(LOG_LEVEL_TRACE_DEF,0))write(logu,format)trim(logl(LOG_LEVEL_TRACE_DEF,__FILE__,__LINE__))//" ", | ||
#else | ||
#define log_root_trace(format) if(.false.)write(logu,format)trim(logl(LOG_LEVEL_TRACE_DEF,__FILE__,__LINE__))//" ", | ||
#endif |
Oops, something went wrong.