Quick and easy to use logging library for Modern Fortran applications
- Fast and lightweight logging library
- Text highlighting
- Log filtering
- Save logs to logfile
type(FloggerUnit) :: flogs = FloggerUnit("levelClassificationTest")
call flogs%debug("Message Test Debug 1")
call flogs%info("Message Test Info 1")
call flogs%notice("Message Test Notice 1")
call flogs%warning("Message Test Warning 1")
call flogs%error("Message Test Error 1")
call flogs%fatal("Message Test Fatal 1")
-
USE
the flogger modulefor every program scope, you need to
USE
the flogger module with this following commandUSE Flogger
-
Initiate the FloggerUnit with identifier
You can initialize multiple instances of
FloggerUnit
and give different labels for each unit. Here's how to initiate theFloggerUnit
objecttype(FloggerUnit) :: flogMain = FloggerUnit("ClassMainTest") type(FloggerUnit) :: flogMidDebug = FloggerUnit("MiddleDebug") type(FloggerUnit) :: flogMidWarning = FloggerUnit("MiddleWarning")
-
call
the logging subroutinesTo make the log message you need to call the object methods from the corresponding
FloggerUnit
instances as follows.call flogs%debug("Message Test Debug 2") call flogs%notice("Message Test Notice 2") call flogMidWarning%warning("Message Test Warning 4") call flogMidWarning%error("Message Test Error 4") call flogMidDebug%fatal("Message Test Fatal 4") call flogMidDebug%info("Message Test Info 2")
-
Set flogger options
Flogger logging behavior can be changed using
SET_FLOGGER_OPTIONS
subroutine. Here is the examplecall SET_FLOGGER_OPTIONS(Level=FLOGS_SET_RELEASE) ! set to release mode call SET_FLOGGER_OPTIONS(Level=FLOGS_SET_SILENT) ! set to silent mode call SET_FLOGGER_OPTIONS(FileOutput=.true.) ! make flogger build logfiles
under development...
Arif Y. Sunanhadikusuma (Soen)
---
Civil Engineering (S.T.)
Department of Civil Engineering
Parahyangan Catholic University, Indonesia
---
Geotechnical Engineering (M.Sc)
Civiel Techniek en Geowetenschappen (CiTG)
TU Delft, The Netherlands