A wrapper for Fortran-stdlib logger, categorizing log messages and extending the feature by the operator chaining.
I need log-message categorization, not detaied log leveling.
- Modern Fortran compiler
- The compilers and versions listed below have been used to develop catechin.
- gfortran 11.2 bundled with quickstart Fortran on Windows
- Intel Fortran Classic 2021.5.0 Build 20211109_000000
- NAG Fortran 7.1 Build 7117
- Fortran-stdlib
- catechin is a wrapper for logger provided by the Fortran-stdlib.
- Fortran Package Manager (fpm) 0.7.0 alpha
- catechin is created as an fpm project.
- test-drive 0.4.0
- FORD (optional)
To get the code, execute the following commnad:
git clone https://github.com/degawa/catechin.git
cd catechin
To build the library using fpm, execute the following command:
fpm build
Then, install the library using:
fpm install --prefix path/to/your/libdir
Add the following use
statement to modules or procedures calling par-funnel.
use :: catechin
To use par-funnel in your fpm project, add the following to the fpm.toml.
[dependencies]
catechin = {git = "https://github.com/degawa/catechin.git"}
catechin provides 2 logging subroutines.
logging(level, message, module, procedure, purpose, category)
logging(logger(purpose, level, category))
logger()
can be extended using operators provided by catechin, likelogging(logger(purpose, level, category) .in. module("module name") .in. procedure("procedure name") .message. "log message")
catechin uses several loggers for different purposes. The loggers can be configured via configure
subroutine.
configure(purpose, level, timestamp, filename, stdout, log_unit, stat)
purpose
: loggerlevel
: log leveltimestamp
: flag to prepend the time stampfilename
: filename for logging of specific purposestdout
: flag to write a log message to stdout when log messages are output to a filelog_unit
: unit number opened to output log messages to a filestat
: status of configuration
call logging(Lv%ERROR, "error", purpose=Pur%Trace, category="test.configure.level.warn")
! 2023-04-09 21:56:33.411: ERROR: [trace]: [test.configure.level.warn]: error
call logging(logger(Pur%Report, Lv%INFO, "category") .in.procedure("procedure") &
.message."log message")
! 2023-04-09 21:58:28.859: procedure: INFO: [report]: [category]: log message
- To add and refine unit tests.
- To add docstrings.
- To add procedure/operator for outputting variable in key-value format.