├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── doc ├── css │ ├── bootstrap.css │ ├── bootstrap.min.css │ ├── font-awesome.css │ ├── font-awesome.min.css │ ├── local.css │ └── pygments.css ├── favicon.png ├── fonts │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff ├── index.html ├── js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── ie10-viewport-bug-workaround.js │ ├── jquery-2.1.3.min.js │ └── svg-pan-zoom.min.js ├── lists │ ├── files.html │ ├── modules.html │ └── procedures.html ├── module │ ├── flogging.html │ └── vt100.html ├── proc │ ├── log_disable_cli_arguments.html │ ├── log_set_disable_colors.html │ ├── log_set_output_date.html │ ├── log_set_output_fileline.html │ ├── log_set_output_hostname.html │ ├── log_set_output_severity.html │ ├── log_set_output_time.html │ ├── log_set_skip_terminal_check.html │ ├── logl.html │ ├── logp.html │ ├── stput.html │ └── tput.html ├── search.html ├── sourcefile │ ├── flogging.f90.html │ └── vt100.f90.html ├── src │ ├── flogging.f90 │ └── vt100.f90 └── tipuesearch │ ├── img │ ├── loader.gif │ └── search.png │ ├── tipuesearch.css │ ├── tipuesearch.js │ ├── tipuesearch.min.js │ ├── tipuesearch_content.js │ └── tipuesearch_set.js ├── flogging.md ├── include └── flogging.h ├── src ├── flogging.f90 └── vt100.f90 └── tests ├── test.f90 └── test_mpi.f90 /.gitignore: -------------------------------------------------------------------------------- 1 | .fuse_hidden* 2 | *.o 3 | *.so 4 | test 5 | test_mpi 6 | *.mod 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Daan van Vugt 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Builds flogging as a shared library 2 | 3 | F90=.f90 4 | OBJ=.o 5 | LIB = libflogging.so 6 | SRC = src 7 | BUILD = $(SRC) 8 | 9 | 10 | FC = mpif90 11 | FLAGS = -fpic -O3 -cpp -ffree-line-length-none -Iinclude 12 | 13 | ifeq (USE_MPI,1) 14 | FLAGS += -DUSE_MPI 15 | endif 16 | 17 | SOURCES = $(wildcard $(SRC)/*$(F90)) 18 | OBJS = $(patsubst $(SRC)/%$(F90), $(BUILD)/%$(OBJ), $(SOURCES)) 19 | 20 | $(LIB): $(OBJS) 21 | $(FC) -shared -o $(LIB) $(OBJS) 22 | 23 | $(BUILD)/%$(OBJ): $(SRC)/%$(F90) 24 | $(FC) $(FLAGS) -c $< -o $@ 25 | 26 | $(BUILD)/flogging.o: $(BUILD)/vt100.o 27 | 28 | # Some test executables 29 | # 30 | test : src/flogging.f90 tests/test.f90 src/vt100.f90 include/flogging.h 31 | mpifort $(FLAGS) -Iinclude src/vt100.f90 src/flogging.f90 tests/test.f90 -o test 32 | 33 | test_mpi : src/flogging.f90 tests/test_mpi.f90 src/vt100.f90 include/flogging.h 34 | mpifort $(FLAGS) -DUSE_MPI -Iinclude src/vt100.f90 src/flogging.f90 tests/test_mpi.f90 -o test_mpi 35 | 36 | .PHONY: clean doc 37 | clean: 38 | @find . -name '*.o' -delete 39 | @find . -name '*.mod' -delete 40 | @find . -name '*.so' -delete 41 | @rm -f test test_mpi 42 | 43 | doc: 44 | ford flogging.md 45 | doc_deploy: doc 46 | git subtree push --prefix doc origin gh-pages 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flogging 2 | This logging system aims to be simple to use, similar to existing write statements and therefore easy to implement in existing codes, 3 | while providing some convenient extra features not present in fortran by default. 4 | 5 | Usage is very simple: 6 | ```fortran 7 | use flogging 8 | ``` 9 | 10 | To load the logging module and its utility functions. 11 | To use the preprovided macros, include the header file and turn on the preprocessor by compiling with `-cpp` 12 | ```C 13 | #include "flogging.h" 14 | ``` 15 | This macro defines the following functions: 16 | ```fortran 17 | log_fatal(format) 18 | log_error(format) 19 | log_warn(format) 20 | log_info(format) 21 | log_debug(format) 22 | log_trace(format) 23 | 24 | log_root_fatal(format) 25 | log_root_error(format) 26 | log_root_warn(format) 27 | log_root_info(format) 28 | log_root_debug(format) 29 | log_root_trace(format) 30 | ``` 31 | Where `format` is usually `*`, but can be adjusted to suit your needs. Remember to include a single `A` specifier for the log lead if you set it yourself. 32 | 33 | The functions print a log message only if the level is greater than or equal to the current minimum loglevel. 34 | The second functions include a check to print a log message only from the root MPI process, if compiled 35 | with `USE_MPI`. If not compiled with `USE_MPI`, it works the same as the log function. 36 | 37 | If you do not want to use the preprocessor macros, you can log like this. 38 | ```fortran 39 | if (logp(LEVEL)) then 40 | write(logu,FORMAT) trim(logl(LEVEL))//" ", "this is a log message" 41 | endif 42 | ``` 43 | Note that it is not possible to use the filename and linenumber features then. 44 | 45 | # Installation 46 | You can compile `flogging.f90` and `vt100.f90` into a library `flogging.so` with `make`. 47 | To compile with MPI support use 48 | ```bash 49 | make USE_MPI=1 50 | ``` 51 | Then, place `libflogging.so` into your `LD_LIBRARY_PATH` and put `flogging.h` into your include path. 52 | 53 | ## Compilation flags 54 | Compile your own code with 55 | ``` 56 | -DDISABLE_LOG_DEBUG 57 | ``` 58 | to remove any debug statements from your code. Note that you cannot use `-v` to get these back then. 59 | By default any `log_trace` messages are not included in the executable. Compile with 60 | ``` 61 | -DENABLE_LOG_TRACE 62 | ``` 63 | to get these back. Note that you still need to use `-vv` (by default) to see the messages. 64 | This is a good compilation flag to have in your debug build profile. 65 | 66 | ## Transitioning to flogging 67 | You can change all of the messages in your application to the `log_info` level by 68 | ```bash 69 | git sed 's/write ?(\*,\*)/log_info(*)/g' 70 | ``` 71 | You might need to split some lines, as the `__FILE__` and `__LINE__` macros require quite some space. 72 | This can also be circumvented by compiling with `-ffree-line-length-none` or equivalent. 73 | 74 | # Examples 75 | ```fortran 76 | log_error(*) "this is an error" 77 | log_warn(*) "this is a warning" 78 | log_info(*) "here, have some info" 79 | log_debug(*) "and this is a debug message" 80 | ``` 81 | outputs (without any compilation flags) 82 | ``` 83 | localhost test.f90:9 ERROR this is an error 84 | localhost test.f90:10 WARN this is a warning 85 | localhost test.f90:11 INFO here, have some info 86 | ``` 87 | (The leading space is a consequence of using the fortran * format specifier) 88 | 89 | ## Interface 90 | The module `flogging` defines some subroutines you can use to alter it's behaviour: 91 | ```fortran 92 | public :: log_set_output_hostname 93 | public :: log_set_output_severity 94 | public :: log_set_output_date 95 | public :: log_set_time_only 96 | public :: log_set_output_fileline 97 | public :: log_set_skip_terminal_check 98 | public :: log_set_disable_colors 99 | public :: log_disable_cli_arguments 100 | ``` 101 | 102 | ## Command-line flags 103 | The logging module allows the following command-line flags, checked at the time of the first log output. 104 | ``` 105 | -v, --verbose Increase the logging verbosity 106 | -q, --quiet Decrease the logging verbosity 107 | --log-output-hostname Output the hostname in the log lead 108 | --log-force-colors Force colors, even when outputting to a file 109 | --log-no-colors Disable colors (overrides --log-force-colors) 110 | --log-output-date Output the date in the log lead 111 | --log-output-time Output the time in the log lead 112 | ``` 113 | 114 | ### Argument parsing 115 | By default, flogging parses the command-line arguments above on the first invocation of `log()`. 116 | If you want to use your own argument parsing you can disable this behaviour by calling `log_disable_cli_arguments` before any output is logged. 117 | 118 | ## Output to a file 119 | Logging is to stderr by default. Another output unit can be selected by setting 120 | ```fortran 121 | logu = some_unit 122 | ``` 123 | This will probably not work well with MPI. 124 | 125 | ## Internals 126 | The latest documentation can be found [here](http://exteris.github.io/flogging/). 127 | 128 | The module defines a function defining whether or not to print this log message, 129 | ```fortran 130 | logp(level) 131 | ``` 132 | where level is one of `LOG_FATAL`, `LOG_ERROR`, `LOG_WARN`, `LOG_INFO`, `LOG_DEBUG` or `LOG_TRACE`. 133 | The logp function can also be used with MPI support, using an optional integer parameter `only_n` to return true 134 | only if the level is sufficient and the MPI rank of the current thread is equal to `only_n`. 135 | This can be used to print messages only from the root thread, to prevent log messages from being printed N times as shown below. 136 | ```fortran 137 | logp(level,0) 138 | ``` 139 | 140 | ## Contributing 141 | Pull requests and comments are appreciated. 142 | 143 | ## TODO 144 | - Argument parsing is quite flaky (try -qqqqqq and see what happens) 145 | - Time and date output at the same time does not work yet 146 | - Compilation flag to control argument parsing 147 | - Log output to a different file per MPI process 148 | - Multiple logging streams/outputs (this will be tricky) 149 | -------------------------------------------------------------------------------- /doc/css/local.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 70px; 3 | } 4 | table.nostretch { 5 | width=100% 6 | } 7 | .nostretch td { 8 | class='block' 9 | } 10 | .nostretch tr td{ 11 | width:1%; 12 | white-space:nowrap; 13 | } 14 | 15 | ol.hierarchy { 16 | min-height: 40px; 17 | background-color: #f5f5f5; 18 | border: 1px solid #e3e3e3; 19 | border-radius: 3px; 20 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); 21 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); 22 | } 23 | 24 | .smallcaps { 25 | font-variant: small-caps; 26 | } 27 | .well .sidebar { 28 | padding: 8px 0 29 | } 30 | .sidebar a { 31 | padding: 0px,0px,0px,0px 32 | } 33 | .varlist>tbody>tr>td { 34 | padding-left: 3px; 35 | padding-right: 3px; 36 | } 37 | .varlist>tbody>tr>td:first-child, .varlist>thead>tr>td:first-child { 38 | padding-left: 8px; 39 | } 40 | .varlist>tbody>td>td:last-child, .varlist>thead>tr>td:last-child { 41 | padding-right: 8px; 42 | } 43 | 44 | .highlight pre { 45 | overflow-x: auto; 46 | overflow-wrap: normal; 47 | white-space: pre 48 | } 49 | 50 | /* .hl is for when line numbers are included, .highlight is for all 51 | other cases. */ 52 | .hl pre { 53 | counter-reset: line-numbering; 54 | overflow-x: auto; 55 | overflow-wrap: normal; 56 | white-space: pre; 57 | padding: 0; 58 | padding-right: 9.5px; 59 | overflow-y: hidden; 60 | padding-bottom: 9.5px; 61 | } 62 | 63 | .hl pre a::before { 64 | content: counter(line-numbering); 65 | counter-increment: line-numbering; 66 | padding-right: 0.7em; /* space after numbers */ 67 | margin-top: 4.5em; 68 | width: 60px; 69 | text-align: right; 70 | opacity: 0.7; 71 | display: inline-block; 72 | color: #aaa; 73 | background: #eee; 74 | margin-right: 10px; 75 | border-right: 1px solid #ccc; 76 | -webkit-touch-callout: none; 77 | -webkit-user-select: none; 78 | -khtml-user-select: none; 79 | -moz-user-select: none; 80 | -ms-user-select: none; 81 | user-select: none; 82 | } 83 | 84 | .hl pre a:first-of-type::before { 85 | padding-top: 9.5px; 86 | } 87 | 88 | .hl pre a:last-of-type::before { 89 | padding-bottom: 9.5px; 90 | } 91 | 92 | .hl pre a:only-of-type::before { 93 | padding: 9.5px; 94 | } 95 | 96 | .hl pre a { 97 | display: inline-block; 98 | height: 4.5em; 99 | margin: -4.5em 0 0; 100 | } 101 | .codesum h3 { 102 | margin-top: 2px; 103 | margin-bottom: 2px; 104 | } 105 | 106 | h1.inline, h2.inline, h3.inline { 107 | display: inline; 108 | } 109 | 110 | .depwarn { 111 | float: right; 112 | } 113 | 114 | .anchor { 115 | position: absolute; 116 | margin: -4.5em; 117 | visibility:hidden; 118 | } 119 | 120 | .alert { 121 | margin-left: 5px; 122 | margin-right: 5px; 123 | margin-top: 5px; 124 | } 125 | 126 | div.toc { 127 | font-size: 14.73px; 128 | padding-left: 0px; 129 | padding-right: 0px; 130 | } 131 | 132 | div.toc a { 133 | padding-left: 20px; 134 | padding-right: 20px; 135 | margin-right: 15px; 136 | padding-top: 5px; 137 | padding-bottom: 5px; 138 | } 139 | 140 | div.toc li { 141 | font-size: 0.95em; 142 | padding-left: 15px; 143 | } 144 | 145 | div.toc li.title { 146 | font-size: 1em; 147 | } 148 | 149 | div.toc hr { 150 | margin-top: 12px; 151 | margin-bottom: 10px; 152 | } 153 | 154 | .in-well { 155 | padding: 0px 0px; 156 | margin-bottom: 0px; 157 | float:right; 158 | } 159 | 160 | table tr.submod>td { 161 | border-top: none; 162 | font-size: 13.5px; 163 | } 164 | 165 | .graph-help { 166 | font-size: 10px; 167 | } 168 | 169 | .depgraph { 170 | width: 100%; 171 | max-width: 1140px; 172 | } 173 | 174 | #sidebar a { 175 | white-space: nowrap; 176 | overflow: hidden; 177 | text-overflow: ellipsis; 178 | } 179 | 180 | .highlighttable { 181 | width: auto; 182 | table-layout: fixed; 183 | } 184 | 185 | ul.checklist { 186 | list-style-type: none; 187 | } 188 | 189 | ul.checklist input[type="checkbox"] { 190 | margin-left: -20.8px; 191 | margin-right: 4.55px; 192 | } 193 | 194 | .gitter-chat-embed { 195 | z-index: 100000; 196 | } 197 | -------------------------------------------------------------------------------- /doc/css/pygments.css: -------------------------------------------------------------------------------- 1 | .hll { background-color: #ffffcc } 2 | .c { color: #408080; font-style: italic } /* Comment */ 3 | .err { border: 1px solid #FF0000 } /* Error */ 4 | .k { color: #008000; font-weight: bold } /* Keyword */ 5 | .o { color: #666666 } /* Operator */ 6 | .cm { color: #408080; font-style: italic } /* Comment.Multiline */ 7 | .cp { color: #BC7A00 } /* Comment.Preproc */ 8 | .c1 { color: #408080; font-style: italic } /* Comment.Single */ 9 | .cs { color: #408080; font-style: italic } /* Comment.Special */ 10 | .gd { color: #A00000 } /* Generic.Deleted */ 11 | .ge { font-style: italic } /* Generic.Emph */ 12 | .gr { color: #FF0000 } /* Generic.Error */ 13 | .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 14 | .gi { color: #00A000 } /* Generic.Inserted */ 15 | .go { color: #888888 } /* Generic.Output */ 16 | .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ 17 | .gs { font-weight: bold } /* Generic.Strong */ 18 | .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 19 | .gt { color: #0044DD } /* Generic.Traceback */ 20 | .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ 21 | .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ 22 | .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ 23 | .kp { color: #008000 } /* Keyword.Pseudo */ 24 | .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ 25 | .kt { color: #B00040 } /* Keyword.Type */ 26 | .m { color: #666666 } /* Literal.Number */ 27 | .s { color: #BA2121 } /* Literal.String */ 28 | .na { color: #7D9029 } /* Name.Attribute */ 29 | .nb { color: #008000 } /* Name.Builtin */ 30 | .nc { color: #0000FF; font-weight: bold } /* Name.Class */ 31 | .no { color: #880000 } /* Name.Constant */ 32 | .nd { color: #AA22FF } /* Name.Decorator */ 33 | .ni { color: #999999; font-weight: bold } /* Name.Entity */ 34 | .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ 35 | .nf { color: #0000FF } /* Name.Function */ 36 | .nl { color: #A0A000 } /* Name.Label */ 37 | .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ 38 | .nt { color: #008000; font-weight: bold } /* Name.Tag */ 39 | .nv { color: #19177C } /* Name.Variable */ 40 | .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ 41 | .w { color: #bbbbbb } /* Text.Whitespace */ 42 | .mf { color: #666666 } /* Literal.Number.Float */ 43 | .mh { color: #666666 } /* Literal.Number.Hex */ 44 | .mi { color: #666666 } /* Literal.Number.Integer */ 45 | .mo { color: #666666 } /* Literal.Number.Oct */ 46 | .sb { color: #BA2121 } /* Literal.String.Backtick */ 47 | .sc { color: #BA2121 } /* Literal.String.Char */ 48 | .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ 49 | .s2 { color: #BA2121 } /* Literal.String.Double */ 50 | .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ 51 | .sh { color: #BA2121 } /* Literal.String.Heredoc */ 52 | .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ 53 | .sx { color: #008000 } /* Literal.String.Other */ 54 | .sr { color: #BB6688 } /* Literal.String.Regex */ 55 | .s1 { color: #BA2121 } /* Literal.String.Single */ 56 | .ss { color: #19177C } /* Literal.String.Symbol */ 57 | .bp { color: #008000 } /* Name.Builtin.Pseudo */ 58 | .vc { color: #19177C } /* Name.Variable.Class */ 59 | .vg { color: #19177C } /* Name.Variable.Global */ 60 | .vi { color: #19177C } /* Name.Variable.Instance */ 61 | .il { color: #666666 } /* Literal.Number.Integer.Long */ 62 | -------------------------------------------------------------------------------- /doc/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaanVanVugt/flogging/fd8c54cb7a57053b737025a7835ca825856857d3/doc/favicon.png -------------------------------------------------------------------------------- /doc/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaanVanVugt/flogging/fd8c54cb7a57053b737025a7835ca825856857d3/doc/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /doc/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaanVanVugt/flogging/fd8c54cb7a57053b737025a7835ca825856857d3/doc/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /doc/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaanVanVugt/flogging/fd8c54cb7a57053b737025a7835ca825856857d3/doc/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /doc/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaanVanVugt/flogging/fd8c54cb7a57053b737025a7835ca825856857d3/doc/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /doc/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaanVanVugt/flogging/fd8c54cb7a57053b737025a7835ca825856857d3/doc/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /doc/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaanVanVugt/flogging/fd8c54cb7a57053b737025a7835ca825856857d3/doc/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | flogging 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 81 | 82 |
83 | 84 | 85 |
86 |

FLOGGING -- Fortran logging system with MPI support

87 | 88 |

Find us on…

89 |

90 | 91 | GitHub 92 | 93 | 94 | 95 | 96 | 97 | 98 |

99 |
100 | 101 |
102 | 103 |
104 | 105 |

flogging

106 |

This library provides a logging framework for Fortran 90 and up, with MPI support, vt100 colors, command-line arguments and more.

107 |

License

108 |

The bspline-fortran source code and related files and documentation are distributed under a permissive license (MIT).

109 |
110 | 111 |
112 |
113 |

Developer Info

114 |

Daan van Vugt

115 | 116 | 117 | 118 |
119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 |
130 | 131 |
132 |
133 | 134 |
135 | 136 | 137 | 138 | 139 | 140 |
141 |
142 |

Source Files

143 | 154 |
155 | 156 |
157 |

Modules

158 |
    159 | 160 | 161 |
  • flogging
  • 162 | 163 | 164 | 165 |
  • vt100
  • 166 | 167 | 168 |
169 |
170 | 171 | 172 |
173 |

Procedures

174 | 223 |
224 | 225 | 226 |
227 | 228 |
229 | 243 |
244 | 245 | 246 | 248 | 249 | 252 | 253 | 254 | 255 | 256 | 258 | 259 | 269 | 270 | 271 | -------------------------------------------------------------------------------- /doc/js/ie10-viewport-bug-workaround.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014 Twitter, Inc. 4 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For 5 | * details, see http://creativecommons.org/licenses/by/3.0/. 6 | */ 7 | 8 | // See the Getting Started docs for more information: 9 | // http://getbootstrap.com/getting-started/#support-ie10-width 10 | 11 | (function () { 12 | 'use strict'; 13 | if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 14 | var msViewportStyle = document.createElement('style') 15 | msViewportStyle.appendChild( 16 | document.createTextNode( 17 | '@-ms-viewport{width:auto!important}' 18 | ) 19 | ) 20 | document.querySelector('head').appendChild(msViewportStyle) 21 | } 22 | })(); 23 | -------------------------------------------------------------------------------- /doc/lists/files.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | All Files – flogging 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 83 | 84 |
85 | 86 |
87 |
88 |

Source Files

89 | 90 | 91 | 92 | 93 | 96 | 97 | 101 | 102 |
FileDescription
flogging.f90

This module contains a logging system intended for use in MPI 94 | codes, with facilities for colored output, log level filters, 95 | code location and date and time annotation.

vt100.f90

This module sets terminal colors, boldness and other settings 98 | Using ANSI/VT100 control sequences 99 | See http://misc.flogisoft.com/bash/tip_colors_and_formatting for a list of sequences 100 | This code is governed by the MIT license. See LICENSE for details.

103 |
104 |
105 | 106 |
107 | 121 |
122 | 123 | 124 | 126 | 127 | 130 | 131 | 132 | 133 | 134 | 136 | 137 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /doc/lists/modules.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | All Modules – flogging 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 83 | 84 |
85 | 86 | 87 |
88 |
89 |

Modules

90 | 91 | 92 | 93 | 94 | 95 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 |
ModuleSource FileDescription
floggingflogging.f90

Settings functions (public) 96 | Logging functions (public) 97 | ** Utility functions (private)

vt100vt100.f90
106 | 107 |
108 | 110 | 112 | 113 | 115 | 116 | module~~graph~~ModuleGraph 117 | 118 | 119 | module~flogging 120 | 121 | 122 | flogging 123 | 124 | 125 | 126 | 127 | module~vt100 128 | 129 | 130 | vt100 131 | 132 | 133 | 134 | 135 | module~vt100->module~flogging 136 | 137 | 138 | 139 | 140 | iso_fortran_env 141 | 142 | 143 | iso_fortran_env 144 | 145 | 146 | 147 | 148 | iso_fortran_env->module~flogging 149 | 150 | 151 | 152 | 153 | 154 |
155 |
Help
156 | 246 | 247 |
248 |
249 | 250 |
251 | 265 |
266 | 267 | 268 | 270 | 271 | 274 | 275 | 276 | 277 | 278 | 280 | 281 | 291 | 292 | 293 | -------------------------------------------------------------------------------- /doc/proc/log_disable_cli_arguments.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | log_disable_cli_arguments – flogging 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 81 | 82 |
83 | 84 | 85 |
86 |

log_disable_cli_arguments 87 | Subroutine 88 | 89 |

90 | 91 |
92 |
93 |
94 |
    95 | 96 | 97 | 98 | 99 | 100 | 101 |
  • Source File
  • 102 | 103 |
104 | 112 |
113 |
114 |
115 | 116 |
117 | 118 |
119 |
120 | 121 | 177 | 178 |
179 | 180 |
181 |

182 | public subroutine log_disable_cli_arguments() 183 | 184 | 185 | 186 |

187 | 188 | 189 | 190 | 191 | 192 |

Arguments

193 | 194 | None 195 | 196 | 197 | 198 |

Description

199 |

Disable reading arguments from the commandline

200 | 201 | 202 | 203 |
204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 |
222 |
223 | 224 |
225 | 239 |
240 | 241 | 242 | 244 | 245 | 248 | 249 | 250 | 251 | 252 | 254 | 255 | 265 | 266 | 267 | -------------------------------------------------------------------------------- /doc/proc/log_set_disable_colors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | log_set_disable_colors – flogging 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 81 | 82 |
83 | 84 | 85 |
86 |

log_set_disable_colors 87 | Subroutine 88 | 89 |

90 | 91 |
92 |
93 |
94 |
    95 | 96 | 97 | 98 | 99 | 100 | 101 |
  • Source File
  • 102 | 103 |
104 | 112 |
113 |
114 |
115 | 116 |
117 | 118 |
119 |
120 | 121 | 177 | 178 |
179 | 180 |
181 |

182 | public subroutine log_set_disable_colors(bool) 183 | 184 | 185 | 186 |

187 | 188 | 189 | 190 | 191 | 192 |

Arguments

193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 |
TypeIntentOptionalAttributesName
logical,intent(in)::bool
221 | 222 | 223 | 224 | 225 |

Description

226 |

Disable colors altogether

227 | 228 | 229 | 230 |
231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 |
249 |
250 | 251 |
252 | 266 |
267 | 268 | 269 | 271 | 272 | 275 | 276 | 277 | 278 | 279 | 281 | 282 | 292 | 293 | 294 | -------------------------------------------------------------------------------- /doc/proc/log_set_output_date.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | log_set_output_date – flogging 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 81 | 82 |
83 | 84 | 85 |
86 |

log_set_output_date 87 | Subroutine 88 | 89 |

90 | 91 |
92 |
93 |
94 |
    95 | 96 | 97 | 98 | 99 | 100 | 101 |
  • Source File
  • 102 | 103 |
104 | 112 |
113 |
114 |
115 | 116 |
117 | 118 |
119 |
120 | 121 | 177 | 178 |
179 | 180 |
181 |

182 | public subroutine log_set_output_date(bool) 183 | 184 | 185 | 186 |

187 | 188 | 189 | 190 | 191 | 192 |

Arguments

193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 |
TypeIntentOptionalAttributesName
logical,intent(in)::bool
221 | 222 | 223 | 224 | 225 |

Description

226 |

Set the default for date output

227 | 228 | 229 | 230 |
231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 |
249 |
250 | 251 |
252 | 266 |
267 | 268 | 269 | 271 | 272 | 275 | 276 | 277 | 278 | 279 | 281 | 282 | 292 | 293 | 294 | -------------------------------------------------------------------------------- /doc/proc/log_set_output_fileline.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | log_set_output_fileline – flogging 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 81 | 82 |
83 | 84 | 85 |
86 |

log_set_output_fileline 87 | Subroutine 88 | 89 |

90 | 91 |
92 |
93 |
94 |
    95 | 96 | 97 | 98 | 99 | 100 | 101 |
  • Source File
  • 102 | 103 |
104 | 112 |
113 |
114 |
115 | 116 |
117 | 118 |
119 |
120 | 121 | 177 | 178 |
179 | 180 |
181 |

182 | public subroutine log_set_output_fileline(bool) 183 | 184 | 185 | 186 |

187 | 188 | 189 | 190 | 191 | 192 |

Arguments

193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 |
TypeIntentOptionalAttributesName
logical,intent(in)::bool
221 | 222 | 223 | 224 | 225 |

Description

226 |

Set the default for file/line output

227 | 228 | 229 | 230 |
231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 |
249 |
250 | 251 |
252 | 266 |
267 | 268 | 269 | 271 | 272 | 275 | 276 | 277 | 278 | 279 | 281 | 282 | 292 | 293 | 294 | -------------------------------------------------------------------------------- /doc/proc/log_set_output_hostname.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | log_set_output_hostname – flogging 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 81 | 82 |
83 | 84 | 85 |
86 |

log_set_output_hostname 87 | Subroutine 88 | 89 |

90 | 91 |
92 |
93 |
94 |
    95 | 96 | 97 | 98 | 99 | 100 | 101 |
  • Source File
  • 102 | 103 |
104 | 112 |
113 |
114 |
115 | 116 |
117 | 118 |
119 |
120 | 121 | 177 | 178 |
179 | 180 |
181 |

182 | public subroutine log_set_output_hostname(bool) 183 | 184 | 185 | 186 |

187 | 188 | 189 | 190 | 191 | 192 |

Arguments

193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 |
TypeIntentOptionalAttributesName
logical,intent(in)::bool
221 | 222 | 223 | 224 | 225 |

Description

226 |

Set the default for hostname output

227 | 228 | 229 | 230 |
231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 |
249 |
250 | 251 |
252 | 266 |
267 | 268 | 269 | 271 | 272 | 275 | 276 | 277 | 278 | 279 | 281 | 282 | 292 | 293 | 294 | -------------------------------------------------------------------------------- /doc/proc/log_set_output_severity.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | log_set_output_severity – flogging 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 81 | 82 |
83 | 84 | 85 |
86 |

log_set_output_severity 87 | Subroutine 88 | 89 |

90 | 91 |
92 |
93 |
94 |
    95 | 96 | 97 | 98 | 99 | 100 | 101 |
  • Source File
  • 102 | 103 |
104 | 112 |
113 |
114 |
115 | 116 |
117 | 118 |
119 |
120 | 121 | 177 | 178 |
179 | 180 |
181 |

182 | public subroutine log_set_output_severity(bool) 183 | 184 | 185 | 186 |

187 | 188 | 189 | 190 | 191 | 192 |

Arguments

193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 |
TypeIntentOptionalAttributesName
logical,intent(in)::bool
221 | 222 | 223 | 224 | 225 |

Description

226 |

Set the default for severity output

227 | 228 | 229 | 230 |
231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 |
249 |
250 | 251 |
252 | 266 |
267 | 268 | 269 | 271 | 272 | 275 | 276 | 277 | 278 | 279 | 281 | 282 | 292 | 293 | 294 | -------------------------------------------------------------------------------- /doc/proc/log_set_output_time.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | log_set_output_time – flogging 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 81 | 82 |
83 | 84 | 85 |
86 |

log_set_output_time 87 | Subroutine 88 | 89 |

90 | 91 |
92 |
93 |
94 |
    95 | 96 | 97 | 98 | 99 | 100 | 101 |
  • Source File
  • 102 | 103 |
104 | 112 |
113 |
114 |
115 | 116 |
117 | 118 |
119 |
120 | 121 | 177 | 178 |
179 | 180 |
181 |

182 | public subroutine log_set_output_time(bool) 183 | 184 | 185 | 186 |

187 | 188 | 189 | 190 | 191 | 192 |

Arguments

193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 |
TypeIntentOptionalAttributesName
logical,intent(in)::bool
221 | 222 | 223 | 224 | 225 |

Description

226 |

Set time-only date format

227 | 228 | 229 | 230 |
231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 |
249 |
250 | 251 |
252 | 266 |
267 | 268 | 269 | 271 | 272 | 275 | 276 | 277 | 278 | 279 | 281 | 282 | 292 | 293 | 294 | -------------------------------------------------------------------------------- /doc/proc/log_set_skip_terminal_check.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | log_set_skip_terminal_check – flogging 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 81 | 82 |
83 | 84 | 85 |
86 |

log_set_skip_terminal_check 87 | Subroutine 88 | 89 |

90 | 91 |
92 |
93 |
94 |
    95 | 96 | 97 | 98 | 99 | 100 | 101 |
  • Source File
  • 102 | 103 |
104 | 112 |
113 |
114 |
115 | 116 |
117 | 118 |
119 |
120 | 121 | 177 | 178 |
179 | 180 |
181 |

182 | public subroutine log_set_skip_terminal_check(bool) 183 | 184 | 185 | 186 |

187 | 188 | 189 | 190 | 191 | 192 |

Arguments

193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 |
TypeIntentOptionalAttributesName
logical,intent(in)::bool
221 | 222 | 223 | 224 | 225 |

Description

226 |

Whether or not to skip the terminal check

227 | 228 | 229 | 230 |
231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 |
249 |
250 | 251 |
252 | 266 |
267 | 268 | 269 | 271 | 272 | 275 | 276 | 277 | 278 | 279 | 281 | 282 | 292 | 293 | 294 | -------------------------------------------------------------------------------- /doc/proc/stput.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | stput – flogging 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 81 | 82 |
83 | 84 | 85 |
86 |

stput 87 | Subroutine 88 | 89 |

90 | 91 |
92 |
93 |
94 |
    95 | 96 | 97 | 98 | 99 | 100 | 101 |
  • Source File
  • 102 | 103 |
104 | 112 |
113 |
114 |
115 | 116 |
117 | 118 |
119 |
120 | 121 | 177 | 178 |
179 | 180 |
181 |

182 | public subroutine stput(str, code) 183 | 184 | 185 | 186 |

187 | 188 | 189 | 190 | 191 | 192 |

Arguments

193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 |
TypeIntentOptionalAttributesName
character(len=*),intent(inout)::str
character(len=*),intent(in)::code
236 | 237 | 238 | 239 | 240 | 241 | 242 |

Called By

243 | 244 |
245 | 247 | 249 | 250 | 252 | 253 | proc~~stput~~CalledByGraph 254 | 255 | 256 | proc~stput 257 | 258 | stput 259 | 260 | 261 | proc~logl 262 | 263 | 264 | logl 265 | 266 | 267 | 268 | 269 | proc~logl->proc~stput 270 | 271 | 272 | 273 | 274 | 275 |
276 |
Help
277 | 367 | 368 | 369 |
370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 |
388 |
389 | 390 |
391 | 405 |
406 | 407 | 408 | 410 | 411 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 431 | 432 | 433 | -------------------------------------------------------------------------------- /doc/proc/tput.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | tput – flogging 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 81 | 82 |
83 | 84 | 85 |
86 |

tput 87 | Subroutine 88 | 89 |

90 | 91 |
92 |
93 |
94 |
    95 | 96 | 97 | 98 | 99 | 100 | 101 |
  • Source File
  • 102 | 103 |
104 | 112 |
113 |
114 |
115 | 116 |
117 | 118 |
119 |
120 | 121 | 177 | 178 |
179 | 180 |
181 |

182 | public subroutine tput(lu, code) 183 | 184 | 185 | 186 |

187 | 188 | 189 | 190 | 191 | 192 |

Arguments

193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 |
TypeIntentOptionalAttributesName
integer,intent(in)::lu
character(len=*),intent(in)::code
236 | 237 | 238 | 239 | 240 | 241 | 242 |
243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 |
261 |
262 | 263 |
264 | 278 |
279 | 280 | 281 | 283 | 284 | 287 | 288 | 289 | 290 | 291 | 293 | 294 | 304 | 305 | 306 | -------------------------------------------------------------------------------- /doc/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Search Results – flogging 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 83 | 84 |
85 | 86 |
87 |
88 |

Search Results

89 |
90 |
91 |
92 | 104 | 109 | 110 |
111 | 125 |
126 | 127 | 128 | 130 | 131 | 134 | 135 | 136 | 137 | 138 | 140 | 141 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /doc/sourcefile/vt100.f90.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | vt100.f90 – flogging 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 81 | 82 |
83 | 84 | 85 |
86 |

vt100.f90 87 | Source File 88 | 89 |

90 | 91 |
92 |
93 |
94 |
    95 | 96 | 97 | 98 | 99 | 100 | 101 |
  • Source File
  • 102 | 103 |
104 | 108 |
109 |
110 |
111 | 112 |
113 |
114 |
115 | 116 | 172 | 173 |
174 |
175 |
176 |

This module sets terminal colors, boldness and other settings 177 | Using ANSI/VT100 control sequences 178 | See http://misc.flogisoft.com/bash/tip_colors_and_formatting for a list of sequences 179 | This code is governed by the MIT license. See LICENSE for details.

180 |
181 |
182 |
183 |

Source Code

184 |
!************************************************************************
185 | ! This module sets terminal colors, boldness and other settings
186 | ! Using ANSI/VT100 control sequences
187 | ! See http://misc.flogisoft.com/bash/tip_colors_and_formatting for a list of sequences
188 | ! This code is governed by the MIT license. See LICENSE for details.
189 | !************************************************************************
190 | module vt100
191 |   implicit none
192 |   ! Control start character
193 |   character(len=*), parameter :: start = achar(27)
194 |   character(len=*), parameter :: reset = "0"
195 |   ! Styles
196 |   character(len=*), parameter :: bold = "1", dimmed = "2", &
197 |       underline = "4", blink = "5", invert = "7", hidden = "8"
198 |   contains
199 |     subroutine tput(lu, code)
200 |       implicit none
201 |       character(len=*), intent(in) :: code
202 |       integer, intent(in) :: lu
203 |       write(lu, '(a,"[",a,"m")', advance="no") start, code
204 |     end subroutine tput
205 |     subroutine stput(str, code)
206 |       implicit none
207 |       character(len=*), intent(inout) :: str
208 |       character(len=*), intent(in)    :: code
209 |       str = trim(str) // start // "[" // trim(code) // "m"
210 |     end subroutine stput
211 | end module vt100
212 | 
213 | 214 |
215 |
216 |
217 | 218 |
219 | 233 |
234 | 235 | 236 | 238 | 239 | 242 | 243 | 244 | 245 | 246 | 248 | 249 | 259 | 260 | 261 | -------------------------------------------------------------------------------- /doc/src/flogging.f90: -------------------------------------------------------------------------------- 1 | !************************************************************** 2 | ! This module contains a logging system intended for use in MPI 3 | ! codes, with facilities for colored output, log level filters, 4 | ! code location and date and time annotation. 5 | ! 6 | ! This software is governed by the MIT license, found in the 7 | ! file LICENSE. 8 | !************************************************************** 9 | #include "flogging.h" 10 | module flogging 11 | use :: vt100 ! For color output 12 | 13 | #ifdef f2003 14 | use, intrinsic :: iso_fortran_env, only: stdin=>input_unit, stdout=>output_unit, stderr=>error_unit 15 | #else 16 | #define stdin 5 17 | #define stdout 6 18 | #define stderr 0 19 | #endif 20 | 21 | implicit none 22 | 23 | ! Log levels 24 | integer, public, parameter :: NUM_LOG_LEVELS = 6 !< 1 through 6 (fatal through trace) 25 | integer, public, parameter :: LOG_FATAL = LOG_LEVEL_FATAL_DEF !< = 1, Runtime error causing termination 26 | integer, public, parameter :: LOG_ERROR = LOG_LEVEL_ERROR_DEF !< = 2, Runtime error 27 | integer, public, parameter :: LOG_WARN = LOG_LEVEL_WARN_DEF !< = 3, Warning, but we can continue 28 | integer, public, parameter :: LOG_INFO = LOG_LEVEL_INFO_DEF !< = 4, Interesting events 29 | integer, public, parameter :: LOG_DEBUG = LOG_LEVEL_DEBUG_DEF !< = 5, Detailed debug output, disable by compiling your program with -DDISABLE_LOG_DEBUG 30 | integer, public, parameter :: LOG_TRACE = LOG_LEVEL_TRACE_DEF !< = 6, Extremely detailed output, compile your program with -DENABLE_LOG_TRACE to enable 31 | 32 | integer, public, save :: logu = stderr !< By default, log to stderr 33 | integer, public, save :: minimum_log_level = LOG_INFO !< Note that more critical means a lower number 34 | 35 | 36 | public :: log_set_output_hostname 37 | public :: log_set_output_severity 38 | public :: log_set_output_date 39 | public :: log_set_output_time 40 | public :: log_set_output_fileline 41 | public :: log_set_skip_terminal_check 42 | public :: log_set_disable_colors 43 | public :: log_disable_cli_arguments 44 | 45 | public :: logp, logl 46 | 47 | 48 | 49 | 50 | private 51 | ! Default settings for hostname and severity output 52 | logical, save :: output_hostname = .false. 53 | logical, save :: output_severity = .true. 54 | logical, save :: output_date = .false. 55 | logical, save :: output_time = .false. 56 | logical, save :: output_fileline = .true. 57 | logical, save :: skip_terminal_check = .false. 58 | logical, save :: disable_colors = .false. 59 | logical, save :: cla_checked = .false. 60 | 61 | ! These are the color codes corresponding to the loglevels above 62 | character(len=*), dimension(NUM_LOG_LEVELS), parameter :: color_codes = & 63 | ["31", "31", "33", "32", "34", "30"] 64 | ! These are the styles corresponding to the loglevels above 65 | character(len=*), dimension(NUM_LOG_LEVELS), parameter :: style_codes = & 66 | [bold, reset, reset, reset, reset, reset] 67 | 68 | ! Colors for other output 69 | character(len=*), parameter :: level_color = "20" 70 | 71 | contains 72 | !**** Settings functions (public) 73 | !> Set the default for hostname output 74 | subroutine log_set_output_hostname(bool) 75 | logical, intent(in) :: bool 76 | output_hostname = bool 77 | end subroutine log_set_output_hostname 78 | 79 | !> Set the default for severity output 80 | subroutine log_set_output_severity(bool) 81 | logical, intent(in) :: bool 82 | output_severity = bool 83 | end subroutine log_set_output_severity 84 | 85 | !> Set the default for date output 86 | subroutine log_set_output_date(bool) 87 | logical, intent(in) :: bool 88 | output_date = bool 89 | end subroutine log_set_output_date 90 | 91 | !> Set time-only date format 92 | subroutine log_set_output_time(bool) 93 | logical, intent(in) :: bool 94 | output_time = bool 95 | end subroutine log_set_output_time 96 | 97 | !> Set the default for file/line output 98 | subroutine log_set_output_fileline(bool) 99 | logical, intent(in) :: bool 100 | output_fileline = bool 101 | end subroutine log_set_output_fileline 102 | 103 | !> Whether or not to skip the terminal check 104 | subroutine log_set_skip_terminal_check(bool) 105 | logical, intent(in) :: bool 106 | skip_terminal_check = bool 107 | end subroutine log_set_skip_terminal_check 108 | 109 | !> Disable colors altogether 110 | subroutine log_set_disable_colors(bool) 111 | logical, intent(in) :: bool 112 | disable_colors = bool 113 | end subroutine log_set_disable_colors 114 | 115 | !> Disable reading arguments from the commandline 116 | subroutine log_disable_cli_arguments() 117 | cla_checked = .true. 118 | end subroutine 119 | 120 | 121 | 122 | 123 | 124 | !**** Logging functions (public) 125 | !> Output this log statement or not 126 | function logp(level, only_n) 127 | #ifdef USE_MPI 128 | use mpi 129 | #endif 130 | 131 | integer, intent(in) :: level !< The log level of the current message 132 | integer, intent(in), optional :: only_n !< Show only if the current mpi rank equals only_n 133 | logical :: logp !< Output: true if this log message can be printed 134 | 135 | #ifdef USE_MPI 136 | integer :: rank, ierr 137 | #endif 138 | 139 | ! Check command-line arguments if that has not been done yet 140 | if (.not. cla_checked) call log_check_cli_arguments() 141 | 142 | if (level .le. minimum_log_level) then 143 | logp = .true. 144 | else 145 | logp = .false. 146 | endif 147 | #ifdef USE_MPI 148 | if (logp .and. present(only_n)) then 149 | call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr) 150 | if (rank .ne. only_n) logp = .false. 151 | endif 152 | #endif 153 | end function logp 154 | 155 | !> Write a log lead containing level and optional info 156 | !> The name is shortened to allow for longer log messages without needing continuations 157 | function logl(level, filename, linenum) 158 | ! Input parameters 159 | integer :: level !< The log level 160 | character(len=*), optional :: filename !< An optional filename to add to the log lead 161 | integer, optional :: linenum !< With line number 162 | character(len=300) :: logl !< The output log leader 163 | 164 | ! Internal parameters 165 | character(len=50), dimension(6) :: log_tmp !< The different parts of the log lead 166 | integer :: fn_len !< Add extra spaces after part i 167 | integer :: i,j !< The counter for the different parts 168 | character(4) :: linenum_lj ! left-justified line number 169 | 170 | logical :: show_colors = .false. 171 | i = 1 172 | 173 | ! Set level to 1 if it is too low, skip if too high 174 | if (level .lt. 1) level = 1 175 | if (level .gt. minimum_log_level .or. level .gt. NUM_LOG_LEVELS) return 176 | 177 | ! only show colors if we are outputting to a terminal 178 | if (skip_terminal_check) then 179 | show_colors = .not. disable_colors 180 | else 181 | show_colors = isatty(stdout) .and. .not. disable_colors 182 | endif 183 | ! This works in ifort and gfortran (log_unit is stdout here because log_lead is an internal string) 184 | 185 | ! Initialize log_tmp 186 | log_tmp = "" 187 | fn_len = 0 188 | 189 | ! Reset the colors if needed 190 | if (show_colors) call stput(log_tmp(i), reset) ! Do not increment i to add it before the next space 191 | 192 | ! Write date and time if wanted 193 | if (output_date .or. output_time) then 194 | log_tmp(i) = trim(log_tmp(i)) // log_datetime() 195 | i = i + 1 196 | endif 197 | 198 | ! Write hostname if requested 199 | if (output_hostname) then 200 | log_tmp(i) = trim(log_tmp(i)) // log_hostname() 201 | i = i + 1 202 | endif 203 | 204 | #ifdef USE_MPI 205 | ! Write mpi id 206 | log_tmp(i) = trim(log_tmp(i)) // log_mpi_id() 207 | i = i + 1 208 | #endif 209 | 210 | if (present(filename) .and. output_fileline) then 211 | log_tmp(i) = trim(log_tmp(i)) // trim(filename) 212 | if (present(linenum)) then 213 | ! Left-justify the line number and cap it to 4 characters 214 | write(linenum_lj, '(i4)') linenum 215 | log_tmp(i) = trim(log_tmp(i)) // ":" // adjustl(linenum_lj) 216 | endif 217 | ! How many extra spaces are needed to fill out to multiple of n characters 218 | fn_len = fn_len + len_trim(log_tmp(i)) 219 | i = i+1 220 | endif 221 | 222 | ! Output severity level 223 | if (output_severity) then 224 | fn_len = fn_len + len_trim(log_severity(level, .false.)) 225 | log_tmp(i) = trim(log_tmp(i)) // spaces(mod(7-fn_len,8)+8) // log_severity(level, show_colors) 226 | endif 227 | 228 | ! Set color based on severity level 229 | if (show_colors) then 230 | ! Set bold for errors (must go first, resets the color code otherwise) 231 | call stput(log_tmp(i), style_codes(level)) 232 | call stput(log_tmp(i), color_codes(level)) 233 | endif 234 | 235 | ! Concatenate trim(log_tmp(i)) with spaces in between 236 | logl = log_tmp(1) 237 | do j=2,i 238 | logl = trim(logl) // " " // trim(log_tmp(j)) 239 | enddo 240 | end function logl 241 | 242 | 243 | 244 | 245 | !*** Utility functions (private) 246 | !> Return the hostname in a 50 character string 247 | function log_hostname() 248 | character(len=50) log_hostname 249 | call hostnm(log_hostname) 250 | end function log_hostname 251 | 252 | !> Return n spaces 253 | function spaces(n) 254 | integer, intent(in) :: n !< Maximum is 30 255 | character(len=n) :: spaces 256 | spaces = " " 257 | end function spaces 258 | 259 | !> Return the severity level with colors etc in a 50 char string 260 | function log_severity(level, show_colors) 261 | integer, intent(in) :: level 262 | logical, intent(in) :: show_colors 263 | character(len=50) log_severity 264 | 265 | log_severity = "" 266 | if (show_colors) call stput(log_severity, level_color) 267 | if (level .eq. LOG_FATAL) then 268 | if (show_colors) then 269 | call stput(log_severity, bold) 270 | call stput(log_severity, color_codes(level)) ! error has the same color, for reading convenience 271 | endif 272 | log_severity = trim(log_severity) // "FATAL" 273 | elseif (level .eq. LOG_ERROR) then 274 | if (show_colors) call stput(log_severity, bold) 275 | log_severity = trim(log_severity) // "ERROR" 276 | elseif (level .eq. LOG_WARN) then 277 | log_severity = trim(log_severity) // "WARN" 278 | elseif (level .eq. LOG_INFO) then 279 | log_severity = trim(log_severity) // "INFO" 280 | elseif (level .eq. LOG_DEBUG) then 281 | log_severity = trim(log_severity) // "DEBUG" 282 | elseif (level .eq. LOG_TRACE) then 283 | log_severity = trim(log_severity) // "TRACE" 284 | endif 285 | if (show_colors) call stput(log_severity, reset) 286 | end function log_severity 287 | 288 | #ifdef USE_MPI 289 | !> Return the mpi id of the current process 290 | function log_mpi_id() 291 | use mpi 292 | character(50) :: log_mpi_id !< The mpi id part of a log 293 | character(6) :: mpi_id_lj !< MPI id in string 294 | character(4) :: id_fmt !< The forhmat to print mpi_id_lj in 295 | integer :: rank, n_cpu, ierr 296 | 297 | call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr) 298 | call MPI_COMM_SIZE(MPI_COMM_WORLD, n_cpu, ierr) 299 | if (n_cpu .eq. 1) then 300 | log_mpi_id = "" 301 | else 302 | write(id_fmt, '(A,i1,A)') "(i", ceiling(log10(real(n_cpu))), ")" 303 | write(mpi_id_lj,id_fmt) rank 304 | write(log_mpi_id, '("#",a)') trim(adjustl(mpi_id_lj)) 305 | endif 306 | end function log_mpi_id 307 | #endif 308 | 309 | !> Return the current date, formatted nicely 310 | function log_datetime() 311 | character(50) :: log_datetime !< Output the date here 312 | 313 | character(8) :: date 314 | character(10) :: time 315 | character(5) :: zone 316 | 317 | call date_and_time(date, time, zone) 318 | if (output_date .and. output_time) then 319 | write(log_datetime, '(a,"/",a,"/",a," ",a,":",a,":",a," ")') date(1:4), date(5:6), date(7:8), & 320 | time(1:2), time(3:4), time(5:6) 321 | endif 322 | if (output_time) then 323 | write(log_datetime, '(a,":",a,":",a," ")') time(1:2), time(3:4), time(5:6) 324 | endif 325 | if (output_date) then 326 | write(log_datetime, '(a,"/",a,"/",a," ")') date(1:4), date(5:6), date(7:8) 327 | endif 328 | end function log_datetime 329 | 330 | !> Check the command-line arguments to set the default logging level 331 | !> and color settings. 332 | subroutine log_check_cli_arguments() 333 | integer :: i,length,status 334 | character(len=32) :: arg 335 | 336 | ! Loop over all command-line arguments to look for -v 337 | do i=1,command_argument_count() 338 | call get_command_argument(i,arg,length,status) 339 | if (status .eq. 0) then 340 | select case (trim(arg)) 341 | case ("--verbose") 342 | minimum_log_level = min(NUM_LOG_LEVELS,minimum_log_level+1) 343 | case ("-v") 344 | minimum_log_level = min(NUM_LOG_LEVELS,minimum_log_level+1) 345 | case ("-vv") 346 | minimum_log_level = min(NUM_LOG_LEVELS,minimum_log_level+2) 347 | case ("-vvv") 348 | minimum_log_level = min(NUM_LOG_LEVELS,minimum_log_level+3) 349 | case ("-vvvv") 350 | minimum_log_level = min(NUM_LOG_LEVELS,minimum_log_level+4) 351 | case ("-vvvvv") 352 | minimum_log_level = min(NUM_LOG_LEVELS,minimum_log_level+5) 353 | case ("-q") 354 | minimum_log_level = max(1,minimum_log_level-1) 355 | case ("-qq") 356 | minimum_log_level = max(1,minimum_log_level-2) 357 | case ("-qqq") 358 | minimum_log_level = max(1,minimum_log_level-3) 359 | case ("-qqqq") 360 | minimum_log_level = max(1,minimum_log_level-4) 361 | case ("-qqqqq") 362 | minimum_log_level = max(1,minimum_log_level-5) 363 | case ("--quiet") 364 | minimum_log_level = max(1,minimum_log_level-1) 365 | case ("--log-output-hostname") 366 | output_hostname = .true. 367 | case ("--log-force-colors") 368 | skip_terminal_check = .true. 369 | case ("--log-no-colors") 370 | disable_colors = .true. 371 | case ("--log-output-date") 372 | output_date = .true. 373 | case ("--log-output-time") 374 | output_time = .true. 375 | end select 376 | endif 377 | enddo 378 | cla_checked = .true. 379 | end subroutine log_check_cli_arguments 380 | end module flogging 381 | -------------------------------------------------------------------------------- /doc/src/vt100.f90: -------------------------------------------------------------------------------- 1 | !************************************************************************ 2 | ! This module sets terminal colors, boldness and other settings 3 | ! Using ANSI/VT100 control sequences 4 | ! See http://misc.flogisoft.com/bash/tip_colors_and_formatting for a list of sequences 5 | ! This code is governed by the MIT license. See LICENSE for details. 6 | !************************************************************************ 7 | module vt100 8 | implicit none 9 | ! Control start character 10 | character(len=*), parameter :: start = achar(27) 11 | character(len=*), parameter :: reset = "0" 12 | ! Styles 13 | character(len=*), parameter :: bold = "1", dimmed = "2", & 14 | underline = "4", blink = "5", invert = "7", hidden = "8" 15 | contains 16 | subroutine tput(lu, code) 17 | implicit none 18 | character(len=*), intent(in) :: code 19 | integer, intent(in) :: lu 20 | write(lu, '(a,"[",a,"m")', advance="no") start, code 21 | end subroutine tput 22 | subroutine stput(str, code) 23 | implicit none 24 | character(len=*), intent(inout) :: str 25 | character(len=*), intent(in) :: code 26 | str = trim(str) // start // "[" // trim(code) // "m" 27 | end subroutine stput 28 | end module vt100 29 | -------------------------------------------------------------------------------- /doc/tipuesearch/img/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaanVanVugt/flogging/fd8c54cb7a57053b737025a7835ca825856857d3/doc/tipuesearch/img/loader.gif -------------------------------------------------------------------------------- /doc/tipuesearch/img/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaanVanVugt/flogging/fd8c54cb7a57053b737025a7835ca825856857d3/doc/tipuesearch/img/search.png -------------------------------------------------------------------------------- /doc/tipuesearch/tipuesearch.css: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | Tipue Search 4.0 4 | Copyright (c) 2014 Tipue 5 | Tipue Search is released under the MIT License 6 | http://www.tipue.com/search 7 | */ 8 | 9 | 10 | /* 11 | #tipue_search_input 12 | { 13 | font: 13px/1.6 'open sans', sans-serif; 14 | color: #333; 15 | padding: 12px 12px 12px 40px; 16 | width: 170px; 17 | border: 1px solid #e2e2e2; 18 | border-radius: 0; 19 | -moz-appearance: none; 20 | -webkit-appearance: none; 21 | box-shadow: none; 22 | outline: 0; 23 | margin: 0; 24 | background: #fff url('img/search.png') no-repeat 15px 15px; 25 | } 26 | */ 27 | 28 | #tipue_search_content 29 | { 30 | max-width: 650px; 31 | padding-top: 15px; 32 | margin: 0; 33 | } 34 | #tipue_search_loading 35 | { 36 | padding-top: 60px; 37 | background: #fff url('img/loader.gif') no-repeat left; 38 | } 39 | 40 | #tipue_search_warning_head 41 | { 42 | font: 300 15px/1.6 'Open Sans', sans-serif; 43 | color: #555; 44 | } 45 | #tipue_search_warning 46 | { 47 | font: 300 13px/1.6 'Open Sans', sans-serif; 48 | color: #333; 49 | margin: 7px 0; 50 | } 51 | #tipue_search_warning a 52 | { 53 | color: #36c; 54 | font-weight: 300; 55 | text-decoration: none; 56 | } 57 | #tipue_search_warning a:hover 58 | { 59 | color: #333; 60 | } 61 | #tipue_search_results_count 62 | { 63 | font: 300 13px/1.6 'Open Sans', sans-serif; 64 | color: #333; 65 | } 66 | .tipue_search_content_title 67 | { 68 | font: 300 25px/1.7 'Open Sans', sans-serif; 69 | text-rendering: optimizelegibility; 70 | margin-top: 23px; 71 | } 72 | .tipue_search_content_title a 73 | { 74 | color: #333; 75 | text-decoration: none; 76 | } 77 | .tipue_search_content_title a:hover 78 | { 79 | color: #555; 80 | } 81 | .tipue_search_content_url 82 | { 83 | font: 300 13px/1.7 'Open Sans', sans-serif; 84 | word-break: break-all; 85 | word-break: break-word; 86 | -webkit-hyphens: auto; 87 | -moz-hyphens: auto; 88 | hyphens: auto; 89 | } 90 | .tipue_search_content_url a 91 | { 92 | color: #06c; 93 | text-decoration: none; 94 | } 95 | .tipue_search_content_url a:hover 96 | { 97 | color: #333; 98 | } 99 | .tipue_search_content_text 100 | { 101 | font: 300 15px/1.6 'Open Sans', sans-serif; 102 | color: #555; 103 | word-break: break-all; 104 | word-break: break-word; 105 | -webkit-hyphens: auto; 106 | -moz-hyphens: auto; 107 | hyphens: auto; 108 | margin-top: 3px; 109 | } 110 | .h01 111 | { 112 | color: #333; 113 | font-weight: 400; 114 | } 115 | 116 | #tipue_search_foot 117 | { 118 | margin: 51px 0 21px 0; 119 | } 120 | #tipue_search_foot_boxes 121 | { 122 | padding: 0; 123 | margin: 0; 124 | font: 12px/1 'Open Sans', sans-serif; 125 | } 126 | #tipue_search_foot_boxes li 127 | { 128 | list-style: none; 129 | margin: 0; 130 | padding: 0; 131 | display: inline; 132 | } 133 | #tipue_search_foot_boxes li a 134 | { 135 | padding: 9px 15px 10px 15px; 136 | background-color: #f1f1f1; 137 | border: 1px solid #dcdcdc; 138 | border-radius: 1px; 139 | color: #333; 140 | margin-right: 7px; 141 | text-decoration: none; 142 | text-align: center; 143 | } 144 | #tipue_search_foot_boxes li.current 145 | { 146 | padding: 9px 15px 10px 15px; 147 | background: #fff; 148 | border: 1px solid #dcdcdc; 149 | border-radius: 1px; 150 | color: #333; 151 | margin-right: 7px; 152 | text-align: center; 153 | } 154 | #tipue_search_foot_boxes li a:hover 155 | { 156 | border: 1px solid #ccc; 157 | background-color: #f3f3f3; 158 | } 159 | -------------------------------------------------------------------------------- /doc/tipuesearch/tipuesearch.min.js: -------------------------------------------------------------------------------- 1 | (function($){$.fn.tipuesearch=function(options){var set=$.extend({"show":7,"newWindow":false,"showURL":true,"minimumLength":3,"descriptiveWords":25,"highlightTerms":true,"highlightEveryTerm":false,"mode":"static","liveDescription":"*","liveContent":"*","contentLocation":"tipuesearch/tipuesearch_content.json"},options);return this.each(function(){var tipuesearch_in={pages:[]};$.ajaxSetup({async:false});if(set.mode=="live")for(var i=0;i");var t_2=html.toLowerCase().indexOf("",t_1+7);if(t_1!=-1&&t_2!=-1)var tit=html.slice(t_1+7,t_2);else var tit="No title";tipuesearch_in.pages.push({"title":tit,"text":desc,"tags":cont,"loc":tipuesearch_pages[i]})});if(set.mode=="json")$.getJSON(set.contentLocation,function(json){tipuesearch_in=$.extend({},json)}); 3 | if(set.mode=="static")tipuesearch_in=$.extend({},tipuesearch);var tipue_search_w="";if(set.newWindow)tipue_search_w=' target="_blank"';function getURLP(name){return decodeURIComponent(((new RegExp("[?|&]"+name+"="+"([^&;]+?)(&|#|;|$)")).exec(location.search)||[,""])[1].replace(/\+/g,"%20"))||null}if(getURLP("q")){$("#tipue_search_input").val(getURLP("q"));getTipueSearch(0,true)}$(this).keyup(function(event){if(event.keyCode=="13")getTipueSearch(0,true)});function getTipueSearch(start,replace){$("#tipue_search_content").hide(); 4 | var out="";var results="";var show_replace=false;var show_stop=false;var standard=true;var c=0;found=new Array;var d=$("#tipue_search_input").val().toLowerCase();d=$.trim(d);if(d.match('^"')&&d.match('"$')||d.match("^'")&&d.match("'$"))standard=false;if(standard){var d_w=d.split(" ");d="";for(var i=0;i=set.minimumLength){if(standard){if(replace){var d_r=d;for(var i=0;i$1')}if(tipuesearch_in.pages[i].tags.search(pat)!= 7 | -1)score-=1E5-i;if(d_w[f].match("^-")){pat=new RegExp(d_w[f].substring(1),"i");if(tipuesearch_in.pages[i].title.search(pat)!=-1||tipuesearch_in.pages[i].text.search(pat)!=-1||tipuesearch_in.pages[i].tags.search(pat)!=-1)score=1E9}}if(score<1E9)found[c++]=score+"^"+tipuesearch_in.pages[i].title+"^"+s_t+"^"+tipuesearch_in.pages[i].loc}}else for(var i=0;i$1')}if(tipuesearch_in.pages[i].tags.search(pat)!=-1)score-=1E5-i;if(score<1E9)found[c++]=score+"^"+tipuesearch_in.pages[i].title+"^"+s_t+"^"+tipuesearch_in.pages[i].loc}if(c!=0){if(show_replace==1){out+='
Showing results for '+ 9 | d+"
";out+='
Search instead for '+d_r+"
"}if(c==1)out+='
1 result
';else{c_c=c.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");out+='
'+c_c+" results
"}found.sort();var l_o=0;for(var i=0;i=start&&l_o"+fo[1]+"";if(set.showURL)out+='";var t=fo[2];var t_d="";var t_w=t.split(" ");if(t_w.length"}l_o++}if(c>set.show){var pages=Math.ceil(c/set.show);var page=start/set.show; 11 | out+='
    ';if(start>0)out+='
  • Prev
  • ';if(page<=2){var p_b=pages;if(pages>3)p_b=3;for(var f=0;f'+(f+1)+"";else out+='
  • '+(f+1)+"
  • "}else{var p_b=page+2;if(p_b>pages)p_b=pages;for(var f=page- 12 | 1;f'+(f+1)+"";else out+='
  • '+(f+1)+"
  • "}if(page+1!=pages)out+='
  • Next
  • ';out+="
"}}else out+='
Nothing found
'}else if(show_stop)out+='
Nothing found
Common words are largely ignored
'; 13 | else{out+='
Search too short
';if(set.minimumLength==1)out+='
Should be one character or more
';else out+='
Should be '+set.minimumLength+" characters or more
"}$("#tipue_search_content").html(out);$("#tipue_search_content").slideDown(200);$("#tipue_search_replaced").click(function(){getTipueSearch(0,false)});$(".tipue_search_foot_box").click(function(){var id_v=$(this).attr("id");var id_a= 14 | id_v.split("_");getTipueSearch(parseInt(id_a[0]),id_a[1])})}})}})(jQuery); 15 | -------------------------------------------------------------------------------- /doc/tipuesearch/tipuesearch_set.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | Tipue Search 4.0 4 | Copyright (c) 2014 Tipue 5 | Tipue Search is released under the MIT License 6 | http://www.tipue.com/search 7 | */ 8 | 9 | 10 | var tipuesearch_stop_words = ["and", "be", "by", "do", "for", "he", "how", "if", "is", "it", "my", "not", "of", "or", "the", "to", "up", "what", "when", "use", "who", "she", "my", "his", "her"]; 11 | 12 | var tipuesearch_replace = {"words": [ 13 | {"word": "tipua", "replace_with": "tipue"}, 14 | {"word": "javscript", "replace_with": "javascript"} 15 | ]}; 16 | 17 | var tipuesearch_stem = {"words": [ 18 | {"word": "e-mail", "stem": "email"}, 19 | {"word": "javascript", "stem": "script"}, 20 | {"word": "procedure", "stem": "subroutine"}, 21 | {"word": "procedure", "stem": "function"} 22 | ]}; 23 | 24 | -------------------------------------------------------------------------------- /flogging.md: -------------------------------------------------------------------------------- 1 | project: flogging 2 | project_github: https://github.com/exteris/flogging 3 | summary: FLOGGING -- Fortran logging system with MPI support 4 | author: Daan van Vugt 5 | github: https://github.com/exteris 6 | project_dir: ./src 7 | output_dir: ./doc 8 | docmark: < 9 | docmark_alt: * 10 | predocmark: > 11 | predocmark_alt: # 12 | graph: true 13 | coloured_edges: true 14 | 15 | This library provides a logging framework for Fortran 90 and up, with MPI support, vt100 colors, command-line arguments and more. 16 | 17 | License 18 | --------------- 19 | 20 | The bspline-fortran source code and related files and documentation are distributed under a permissive [license](https://github.com/exteris/flogging/blob/master/LICENSE) (MIT). 21 | -------------------------------------------------------------------------------- /include/flogging.h: -------------------------------------------------------------------------------- 1 | /* This code is governed by the MIT license. See LICENSE for details. */ 2 | /* The lines below have little spacing to ease the fortran line-length requirements */ 3 | 4 | /* Log level constants */ 5 | #define LOG_LEVEL_FATAL_DEF 1 6 | #define LOG_LEVEL_ERROR_DEF 2 7 | #define LOG_LEVEL_WARN_DEF 3 8 | #define LOG_LEVEL_INFO_DEF 4 9 | #define LOG_LEVEL_DEBUG_DEF 5 10 | #define LOG_LEVEL_TRACE_DEF 6 11 | 12 | #define log_macro(level,format) if(logp(level))write(logu,format)trim(logl(level,__FILE__,__LINE__))//" ", 13 | #define log_root(level,format) if(logp(level,0))write(logu,format)trim(logl(level,__FILE__,__LINE__))//" ", 14 | 15 | /* First four log levels */ 16 | #define log_fatal(format) log_macro(LOG_LEVEL_FATAL_DEF,format) 17 | #define log_error(format) log_macro(LOG_LEVEL_ERROR_DEF,format) 18 | #define log_warn(format) log_macro(LOG_LEVEL_WARN_DEF,format) 19 | #define log_info(format) log_macro(LOG_LEVEL_INFO_DEF,format) 20 | 21 | #define log_root_fatal(format) log_root(LOG_LEVEL_FATAL_DEF,format) 22 | #define log_root_error(format) log_root(LOG_LEVEL_ERROR_DEF,format) 23 | #define log_root_warn(format) log_root(LOG_LEVEL_WARN_DEF,format) 24 | #define log_root_info(format) log_root(LOG_LEVEL_INFO_DEF,format) 25 | 26 | #ifdef DISABLE_LOG_DEBUG 27 | #define log_debug(format) if(.false.)write(logu,format) 28 | #define log_root_debug(format) if(.false.)write(logu,format) 29 | #else 30 | #define log_debug(format) log_macro(LOG_LEVEL_DEBUG_DEF,format) 31 | #define log_root_debug(format) log_root(LOG_LEVEL_DEBUG_DEF,format) 32 | #endif 33 | 34 | #ifdef ENABLE_LOG_TRACE 35 | #define log_trace(format) log_macro(LOG_LEVEL_TRACE_DEF,format) 36 | #define log_root_trace(format) log_root(LOG_LEVEL_TRACE_DEF,format) 37 | #else 38 | #define log_trace(format) if(.false.)write(logu,format) 39 | #define log_root_trace(format) if(.false.)write(logu,format) 40 | #endif 41 | -------------------------------------------------------------------------------- /src/flogging.f90: -------------------------------------------------------------------------------- 1 | !************************************************************** 2 | ! This module contains a logging system intended for use in MPI 3 | ! codes, with facilities for colored output, log level filters, 4 | ! code location and date and time annotation. 5 | ! 6 | ! This software is governed by the MIT license, found in the 7 | ! file LICENSE. 8 | !************************************************************** 9 | #include "flogging.h" 10 | module flogging 11 | use :: vt100 ! For color output 12 | 13 | #if defined __INTEL_COMPILER 14 | use ifport 15 | #endif 16 | 17 | #ifdef f2003 18 | use, intrinsic :: iso_fortran_env, only: stdin=>input_unit, stdout=>output_unit, stderr=>error_unit 19 | #else 20 | #define stdin 5 21 | #define stdout 6 22 | #define stderr 0 23 | #endif 24 | 25 | implicit none 26 | 27 | ! Log levels 28 | integer, public, parameter :: NUM_LOG_LEVELS = 6 !< 1 through 6 (fatal through trace) 29 | integer, public, parameter :: LOG_FATAL = LOG_LEVEL_FATAL_DEF !< = 1, Runtime error causing termination 30 | integer, public, parameter :: LOG_ERROR = LOG_LEVEL_ERROR_DEF !< = 2, Runtime error 31 | integer, public, parameter :: LOG_WARN = LOG_LEVEL_WARN_DEF !< = 3, Warning, but we can continue 32 | integer, public, parameter :: LOG_INFO = LOG_LEVEL_INFO_DEF !< = 4, Interesting events 33 | integer, public, parameter :: LOG_DEBUG = LOG_LEVEL_DEBUG_DEF !< = 5, Detailed debug output, disable by compiling your program with -DDISABLE_LOG_DEBUG 34 | integer, public, parameter :: LOG_TRACE = LOG_LEVEL_TRACE_DEF !< = 6, Extremely detailed output, compile your program with -DENABLE_LOG_TRACE to enable 35 | 36 | integer, public, save :: logu = stderr !< By default, log to stderr 37 | integer, public, save :: minimum_log_level = LOG_INFO !< Note that more critical means a lower number 38 | 39 | 40 | public :: log_set_output_hostname 41 | public :: log_set_output_severity 42 | public :: log_set_output_date 43 | public :: log_set_output_time 44 | public :: log_set_output_fileline 45 | public :: log_set_skip_terminal_check 46 | public :: log_set_disable_colors 47 | public :: log_disable_cli_arguments 48 | 49 | public :: logp, logl 50 | 51 | 52 | 53 | 54 | private 55 | ! Default settings for hostname and severity output 56 | logical, save :: output_hostname = .false. 57 | logical, save :: output_severity = .true. 58 | logical, save :: output_date = .false. 59 | logical, save :: output_time = .false. 60 | logical, save :: output_fileline = .true. 61 | logical, save :: skip_terminal_check = .false. 62 | logical, save :: disable_colors = .false. 63 | logical, save :: cla_checked = .false. 64 | 65 | ! These are the color codes corresponding to the loglevels above 66 | character(len=*), dimension(NUM_LOG_LEVELS), parameter :: color_codes = & 67 | ["31", "31", "33", "32", "34", "30"] 68 | ! These are the styles corresponding to the loglevels above 69 | character(len=*), dimension(NUM_LOG_LEVELS), parameter :: style_codes = & 70 | [bold, reset, reset, reset, reset, reset] 71 | 72 | ! Colors for other output 73 | character(len=*), parameter :: level_color = "20" 74 | 75 | contains 76 | !**** Settings functions (public) 77 | !> Set the default for hostname output 78 | subroutine log_set_output_hostname(bool) 79 | logical, intent(in) :: bool 80 | output_hostname = bool 81 | end subroutine log_set_output_hostname 82 | 83 | !> Set the default for severity output 84 | subroutine log_set_output_severity(bool) 85 | logical, intent(in) :: bool 86 | output_severity = bool 87 | end subroutine log_set_output_severity 88 | 89 | !> Set the default for date output 90 | subroutine log_set_output_date(bool) 91 | logical, intent(in) :: bool 92 | output_date = bool 93 | end subroutine log_set_output_date 94 | 95 | !> Set time-only date format 96 | subroutine log_set_output_time(bool) 97 | logical, intent(in) :: bool 98 | output_time = bool 99 | end subroutine log_set_output_time 100 | 101 | !> Set the default for file/line output 102 | subroutine log_set_output_fileline(bool) 103 | logical, intent(in) :: bool 104 | output_fileline = bool 105 | end subroutine log_set_output_fileline 106 | 107 | !> Whether or not to skip the terminal check 108 | subroutine log_set_skip_terminal_check(bool) 109 | logical, intent(in) :: bool 110 | skip_terminal_check = bool 111 | end subroutine log_set_skip_terminal_check 112 | 113 | !> Disable colors altogether 114 | subroutine log_set_disable_colors(bool) 115 | logical, intent(in) :: bool 116 | disable_colors = bool 117 | end subroutine log_set_disable_colors 118 | 119 | !> Disable reading arguments from the commandline 120 | subroutine log_disable_cli_arguments() 121 | cla_checked = .true. 122 | end subroutine 123 | 124 | 125 | 126 | 127 | 128 | !**** Logging functions (public) 129 | !> Output this log statement or not 130 | function logp(level, only_n) 131 | #ifdef USE_MPI 132 | use mpi 133 | #endif 134 | 135 | integer, intent(in) :: level !< The log level of the current message 136 | integer, intent(in), optional :: only_n !< Show only if the current mpi rank equals only_n 137 | logical :: logp !< Output: true if this log message can be printed 138 | 139 | #ifdef USE_MPI 140 | integer :: rank, ierr 141 | #endif 142 | 143 | ! Check command-line arguments if that has not been done yet 144 | if (.not. cla_checked) call log_check_cli_arguments() 145 | 146 | if (level .le. minimum_log_level) then 147 | logp = .true. 148 | else 149 | logp = .false. 150 | endif 151 | #ifdef USE_MPI 152 | if (logp .and. present(only_n)) then 153 | call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr) 154 | if (rank .ne. only_n) logp = .false. 155 | endif 156 | #endif 157 | end function logp 158 | 159 | !> Write a log lead containing level and optional info 160 | !> The name is shortened to allow for longer log messages without needing continuations 161 | function logl(level, filename, linenum) 162 | ! Input parameters 163 | integer :: level !< The log level 164 | character(len=*), optional :: filename !< An optional filename to add to the log lead 165 | integer, optional :: linenum !< With line number 166 | character(len=300) :: logl !< The output log leader 167 | 168 | ! Internal parameters 169 | character(len=50), dimension(6) :: log_tmp !< The different parts of the log lead 170 | integer :: fn_len !< Add extra spaces after part i 171 | integer :: i,j !< The counter for the different parts 172 | character(4) :: linenum_lj ! left-justified line number 173 | character(len=50) :: basename !< Basename stripped from filename 174 | 175 | logical :: show_colors = .false. 176 | i = 1 177 | 178 | ! Set level to 1 if it is too low, skip if too high 179 | if (level .lt. 1) level = 1 180 | if (level .gt. minimum_log_level .or. level .gt. NUM_LOG_LEVELS) return 181 | 182 | ! only show colors if we are outputting to a terminal 183 | if (skip_terminal_check) then 184 | show_colors = .not. disable_colors 185 | else 186 | show_colors = isatty(stdout) .and. .not. disable_colors 187 | endif 188 | ! This works in ifort and gfortran (log_unit is stdout here because log_lead is an internal string) 189 | 190 | ! Initialize log_tmp 191 | log_tmp = "" 192 | fn_len = 0 193 | 194 | ! Reset the colors if needed 195 | if (show_colors) call stput(log_tmp(i), reset) ! Do not increment i to add it before the next space 196 | 197 | ! Write date and time if wanted 198 | if (output_date .or. output_time) then 199 | log_tmp(i) = trim(log_tmp(i)) // log_datetime() 200 | i = i + 1 201 | endif 202 | 203 | ! Write hostname if requested 204 | if (output_hostname) then 205 | log_tmp(i) = trim(log_tmp(i)) // log_hostname() 206 | i = i + 1 207 | endif 208 | 209 | #ifdef USE_MPI 210 | ! Write mpi id 211 | log_tmp(i) = trim(log_tmp(i)) // log_mpi_id() 212 | i = i + 1 213 | #endif 214 | 215 | if (present(filename) .and. output_fileline) then 216 | call strip_path(filename, basename) 217 | log_tmp(i) = trim(log_tmp(i)) // trim(basename) 218 | if (present(linenum)) then 219 | ! Left-justify the line number and cap it to 4 characters 220 | write(linenum_lj, '(i4)') linenum 221 | log_tmp(i) = trim(log_tmp(i)) // ":" // adjustl(linenum_lj) 222 | endif 223 | ! How many extra spaces are needed to fill out to multiple of n characters 224 | fn_len = fn_len + len_trim(log_tmp(i)) 225 | i = i+1 226 | endif 227 | 228 | ! Output severity level 229 | if (output_severity) then 230 | fn_len = fn_len + len_trim(log_severity(level, .false.)) 231 | log_tmp(i) = trim(log_tmp(i)) // spaces(mod(7-fn_len,8)+8) // log_severity(level, show_colors) 232 | endif 233 | 234 | ! Set color based on severity level 235 | if (show_colors) then 236 | ! Set bold for errors (must go first, resets the color code otherwise) 237 | call stput(log_tmp(i), style_codes(level)) 238 | call stput(log_tmp(i), color_codes(level)) 239 | endif 240 | 241 | ! Concatenate trim(log_tmp(i)) with spaces in between 242 | logl = log_tmp(1) 243 | do j=2,i 244 | logl = trim(logl) // " " // trim(log_tmp(j)) 245 | enddo 246 | end function logl 247 | 248 | 249 | 250 | 251 | !*** Utility functions (private) 252 | !> Return the hostname in a 50 character string 253 | function log_hostname() 254 | character(len=50) log_hostname 255 | #if defined __INTEL_COMPILER 256 | integer(4) :: istat 257 | istat = hostnm(log_hostname) 258 | #else 259 | call hostnm(log_hostname) 260 | #endif 261 | end function log_hostname 262 | 263 | !> Return n spaces 264 | function spaces(n) 265 | integer, intent(in) :: n !< Maximum is 30 266 | character(len=n) :: spaces 267 | spaces = " " 268 | end function spaces 269 | 270 | !> Return the severity level with colors etc in a 50 char string 271 | function log_severity(level, show_colors) 272 | integer, intent(in) :: level 273 | logical, intent(in) :: show_colors 274 | character(len=50) log_severity 275 | 276 | log_severity = "" 277 | if (show_colors) call stput(log_severity, level_color) 278 | if (level .eq. LOG_FATAL) then 279 | if (show_colors) then 280 | call stput(log_severity, bold) 281 | call stput(log_severity, color_codes(level)) ! error has the same color, for reading convenience 282 | endif 283 | log_severity = trim(log_severity) // "FATAL" 284 | elseif (level .eq. LOG_ERROR) then 285 | if (show_colors) call stput(log_severity, bold) 286 | log_severity = trim(log_severity) // "ERROR" 287 | elseif (level .eq. LOG_WARN) then 288 | log_severity = trim(log_severity) // "WARN" 289 | elseif (level .eq. LOG_INFO) then 290 | log_severity = trim(log_severity) // "INFO" 291 | elseif (level .eq. LOG_DEBUG) then 292 | log_severity = trim(log_severity) // "DEBUG" 293 | elseif (level .eq. LOG_TRACE) then 294 | log_severity = trim(log_severity) // "TRACE" 295 | endif 296 | if (show_colors) call stput(log_severity, reset) 297 | end function log_severity 298 | 299 | #ifdef USE_MPI 300 | !> Return the mpi id of the current process 301 | function log_mpi_id() 302 | use mpi 303 | character(50) :: log_mpi_id !< The mpi id part of a log 304 | character(6) :: mpi_id_lj !< MPI id in string 305 | character(4) :: id_fmt !< The forhmat to print mpi_id_lj in 306 | integer :: rank, n_cpu, ierr 307 | 308 | call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr) 309 | call MPI_COMM_SIZE(MPI_COMM_WORLD, n_cpu, ierr) 310 | if (n_cpu .eq. 1) then 311 | log_mpi_id = "" 312 | else 313 | write(id_fmt, '(A,i1,A)') "(i", ceiling(log10(real(n_cpu))), ")" 314 | write(mpi_id_lj,id_fmt) rank 315 | write(log_mpi_id, '("#",a)') trim(adjustl(mpi_id_lj)) 316 | endif 317 | end function log_mpi_id 318 | #endif 319 | 320 | !> Return the current date, formatted nicely 321 | function log_datetime() 322 | character(50) :: log_datetime !< Output the date here 323 | 324 | character(8) :: date 325 | character(10) :: time 326 | character(5) :: zone 327 | 328 | call date_and_time(date, time, zone) 329 | if (output_date .and. output_time) then 330 | write(log_datetime, '(a,"/",a,"/",a," ",a,":",a,":",a,".",a," ")') date(1:4), date(5:6), date(7:8), & 331 | time(1:2), time(3:4), time(5:6), time(8:10) 332 | else 333 | if (output_time) then 334 | write(log_datetime, '(a,":",a,":",a,".",a," ")') time(1:2), time(3:4), time(5:6), time(8:10) 335 | endif 336 | if (output_date) then 337 | write(log_datetime, '(a,"/",a,"/",a," ")') date(1:4), date(5:6), date(7:8) 338 | endif 339 | endif 340 | end function log_datetime 341 | 342 | subroutine strip_path(filepath, basename) 343 | character(len=*), intent(in) :: filepath !< The path to be stripped 344 | character(len=*), intent(out) :: basename !< The basename of the filepath 345 | 346 | ! Internal parameters 347 | #ifndef WIN32 348 | character(len=1) :: sep = '/' !< The path separator 349 | #else 350 | character(len=1) :: sep = '\' 351 | #endif 352 | integer :: last_sep_idx 353 | 354 | last_sep_idx = index(filepath, sep, .true.) 355 | basename = filepath(last_sep_idx+1:) 356 | end subroutine 357 | 358 | !> Check the command-line arguments to set the default logging level 359 | !> and color settings. 360 | subroutine log_check_cli_arguments() 361 | integer :: i,length,status 362 | character(len=32) :: arg 363 | 364 | ! Loop over all command-line arguments to look for -v 365 | do i=1,command_argument_count() 366 | call get_command_argument(i,arg,length,status) 367 | if (status .eq. 0) then 368 | select case (trim(arg)) 369 | case ("--verbose") 370 | minimum_log_level = min(NUM_LOG_LEVELS,minimum_log_level+1) 371 | case ("-v") 372 | minimum_log_level = min(NUM_LOG_LEVELS,minimum_log_level+1) 373 | case ("-vv") 374 | minimum_log_level = min(NUM_LOG_LEVELS,minimum_log_level+2) 375 | case ("-vvv") 376 | minimum_log_level = min(NUM_LOG_LEVELS,minimum_log_level+3) 377 | case ("-vvvv") 378 | minimum_log_level = min(NUM_LOG_LEVELS,minimum_log_level+4) 379 | case ("-vvvvv") 380 | minimum_log_level = min(NUM_LOG_LEVELS,minimum_log_level+5) 381 | case ("-q") 382 | minimum_log_level = max(1,minimum_log_level-1) 383 | case ("-qq") 384 | minimum_log_level = max(1,minimum_log_level-2) 385 | case ("-qqq") 386 | minimum_log_level = max(1,minimum_log_level-3) 387 | case ("-qqqq") 388 | minimum_log_level = max(1,minimum_log_level-4) 389 | case ("-qqqqq") 390 | minimum_log_level = max(1,minimum_log_level-5) 391 | case ("--quiet") 392 | minimum_log_level = max(1,minimum_log_level-1) 393 | case ("--log-output-hostname") 394 | output_hostname = .true. 395 | case ("--log-force-colors") 396 | skip_terminal_check = .true. 397 | case ("--log-no-colors") 398 | disable_colors = .true. 399 | case ("--log-output-date") 400 | output_date = .true. 401 | case ("--log-output-time") 402 | output_time = .true. 403 | end select 404 | endif 405 | enddo 406 | cla_checked = .true. 407 | end subroutine log_check_cli_arguments 408 | end module flogging 409 | -------------------------------------------------------------------------------- /src/vt100.f90: -------------------------------------------------------------------------------- 1 | !************************************************************************ 2 | ! This module sets terminal colors, boldness and other settings 3 | ! Using ANSI/VT100 control sequences 4 | ! See http://misc.flogisoft.com/bash/tip_colors_and_formatting for a list of sequences 5 | ! This code is governed by the MIT license. See LICENSE for details. 6 | !************************************************************************ 7 | module vt100 8 | implicit none 9 | ! Control start character 10 | character(len=*), parameter :: start = achar(27) 11 | character(len=*), parameter :: reset = "0" 12 | ! Styles 13 | character(len=*), parameter :: bold = "1", dimmed = "2", & 14 | underline = "4", blink = "5", invert = "7", hidden = "8" 15 | contains 16 | subroutine tput(lu, code) 17 | implicit none 18 | character(len=*), intent(in) :: code 19 | integer, intent(in) :: lu 20 | write(lu, '(a,"[",a,"m")', advance="no") start, code 21 | end subroutine tput 22 | subroutine stput(str, code) 23 | implicit none 24 | character(len=*), intent(inout) :: str 25 | character(len=*), intent(in) :: code 26 | str = trim(str) // start // "[" // trim(code) // "m" 27 | end subroutine stput 28 | end module vt100 29 | -------------------------------------------------------------------------------- /tests/test.f90: -------------------------------------------------------------------------------- 1 | #include "flogging.h" 2 | program test_log 3 | use flogging 4 | 5 | implicit none 6 | ! This is an example program showing logging with different levels( filenames and mpi 7 | 8 | log_error(*) "this is an error" 9 | log_warn(*) "this is a warning" 10 | log_info(*) "here( have some info" 11 | log_debug(*) "and this is a debug message" 12 | 13 | log_debug(*) "and this is a debug message 2" 14 | log_error(*) "this is a warning" 15 | 16 | ! Enable date output 17 | call log_set_output_date(.true.) 18 | log_error(*) "Error from thread 0 with date" 19 | 20 | end program 21 | -------------------------------------------------------------------------------- /tests/test_mpi.f90: -------------------------------------------------------------------------------- 1 | #include "flogging.h" 2 | program test_log 3 | use flogging 4 | use mpi 5 | 6 | implicit none 7 | integer :: ierr 8 | ! This is an example program showing logging with different levels( filenames and mpi 9 | 10 | call MPI_Init(ierr) 11 | 12 | log_error(*) "help we had an error" 13 | log_root_warn(*) "this is a warning with a filename" 14 | log_root_info(*) "here( have some info with a filename" 15 | log_root_debug(*) "and this is a debug message" 16 | log_root_debug(*) "and this is a debug message 2" 17 | log_root_error(*) "this is a warning" 18 | 19 | ! Enable date output 20 | call log_set_output_date(.true.) 21 | log_root_error(*) "Error from thread 0 with line-info and mpi id and date" 22 | 23 | call MPI_Finalize(ierr) 24 | end program 25 | --------------------------------------------------------------------------------