Skip to content

Commit 9ecead3

Browse files
committed
✏️ edit readme and add getting started section
1 parent 96ec490 commit 9ecead3

2 files changed

Lines changed: 53 additions & 8 deletions

File tree

README.md

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,66 @@
11
# Flogger
22
> Quick and easy to use logging library for Modern Fortran applications
33
4-
## Snippets
4+
## Features
5+
6+
* Fast and lightweight logging library
7+
* Text highlighting
8+
* Log filtering
9+
* Save logs to logfile
10+
11+
### Snippets / Examples
512

613
```f90
7-
a bunch of code
8-
```
9-
```sh
10-
echo results
14+
type(FloggerUnit) :: flogs = FloggerUnit("levelClassificationTest")
15+
call flogs%debug("Message Test Debug 1")
16+
call flogs%info("Message Test Info 1")
17+
call flogs%notice("Message Test Notice 1")
18+
call flogs%warning("Message Test Warning 1")
19+
call flogs%error("Message Test Error 1")
20+
call flogs%fatal("Message Test Fatal 1")
1121
```
22+
![snippets results](img/snippets.png)
1223

1324
## Getting Started
1425

15-
### Manual Installation
16-
1. Copy the whole repository to external library folder of the target project
17-
2. Include library in `CMakeLists.txt` at the project root folder.
26+
1. `USE` the flogger module
27+
28+
for every program scope, you need to `USE` the flogger module with this following command
29+
```f90
30+
USE Flogger
31+
```
32+
33+
2. Initiate the FloggerUnit with identifier
34+
35+
You can initialize multiple instances of `FloggerUnit` and give different labels for each unit. Here's how to initiate the `FloggerUnit` object
36+
```f90
37+
type(FloggerUnit) :: flogMain = FloggerUnit("ClassMainTest")
38+
type(FloggerUnit) :: flogMidDebug = FloggerUnit("MiddleDebug")
39+
type(FloggerUnit) :: flogMidWarning = FloggerUnit("MiddleWarning")
40+
```
41+
3. `call` the logging subroutines
42+
43+
To make the log message you need to call the object methods from the corresponding `FloggerUnit` instances as follows.
44+
```f90
45+
call flogs%debug("Message Test Debug 2")
46+
call flogs%notice("Message Test Notice 2")
47+
call flogMidWarning%warning("Message Test Warning 4")
48+
call flogMidWarning%error("Message Test Error 4")
49+
call flogMidDebug%fatal("Message Test Fatal 4")
50+
call flogMidDebug%info("Message Test Info 2")
51+
```
52+
53+
4. Set flogger options
54+
55+
Flogger logging behavior can be changed using `SET_FLOGGER_OPTIONS` subroutine. Here is the example
56+
```f90
57+
call SET_FLOGGER_OPTIONS(Level=FLOGS_SET_RELEASE) ! set to release mode
58+
call SET_FLOGGER_OPTIONS(Level=FLOGS_SET_SILENT) ! set to silent mode
59+
call SET_FLOGGER_OPTIONS(FileOutput=.true.) ! make flogger build logfiles
60+
```
1861
62+
## Documentations
63+
*under development...*
1964
2065
## Author
2166
**Arif Y. Sunanhadikusuma (Soen)** <br>

img/snippets.png

41.1 KB
Loading

0 commit comments

Comments
 (0)