Loading...
Searching...
No Matches
logging.f90
Go to the documentation of this file.
1!> @file
2!! @defgroup group_logging Logging
3!! Global logging and verbosity control for the fpx Fortran preprocessor
4!!
5!! This tiny but essential module that provides a single public logical flag `verbose`
6!! to enable or disable detailed diagnostic output throughout the entire fpx tool
7!! (parser, macro expansion, include handling, conditional compilation, etc.).
8!!
9!! When `verbose = .true.`, the preprocessor prints extensive debugging information
10!! such as:
11!! - Currently processed file and line number
12!! - Active conditional blocks
13!! - Macro expansions (before/after)
14!! - Include file resolution
15!! - Directive handling
16!! - Internal state changes
17!!
18!! This is extremely useful during development, testing, and when debugging complex
19!! macro or include issues in large Fortran projects.
20!!
21!! The flag is intentionally public and module-level so it can be set from anywhere
22!! (command-line driver, interactive mode, or library user).
23!!
24!! <h2 class="groupheader">Examples</h2>
25!!
26!! 1. Enable verbose output from the main program:
27!! @code{.f90}
28!! verbose = .true. ! Turn on all diagnostic messages
29!! call preprocess('src/main.F90', 'build/main.f90')
30!! ...
31!! @endcode
32!!
33!! 2. Temporarily enable verbosity for a single file processing:
34!! @code{.f90}
35!! verbose = .true.
36!! call preprocess('debug_this.F90')
37!! verbose = .false. ! Turn off again
38!! ...
39!! @endcode
40!!
41!! 3. Interactive session with full insight:
42!! @code{.txt}
43!! $ fpx -v input.F90
44!! !> (implementation sets verbose = .true. from command-line ā€œ-vā€)
45!! !> You will see every macro expansion, #ifdef state, include path, etc.
46!! @endcode
47module fpx_logging
48 implicit none; private
49
50 !> @brief Master switch for verbose diagnostic output
51 !! Default value is `.false.` (quiet mode).
52 !! Set to `.true.` to get detailed step-by-step information about
53 !! preprocessing actions. Safe to modify at any time – the change takes
54 !! effect immediately for all subsequent operations.
55 !! @ingroup group_logging
56 logical, public :: verbose
57
58end module
logical, public verbose
Master switch for verbose diagnostic output Default value is .false. (quiet mode)....
Definition logging.f90:56