Lattice Microbes 2.5
This is for whole cell modeling
Loading...
Searching...
No Matches
Print.h
Go to the documentation of this file.
1/*
2 * University of Illinois Open Source License
3 * Copyright 2008-2018 Luthey-Schulten Group,
4 * All rights reserved.
5 *
6 * Developed by: Luthey-Schulten Group
7 * University of Illinois at Urbana-Champaign
8 * http://www.scs.uiuc.edu/~schulten
9 *
10 * Permission is hereby granted, free of charge, to any person obtaining a copy of
11 * this software and associated documentation files (the Software), to deal with
12 * the Software without restriction, including without limitation the rights to
13 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
14 * of the Software, and to permit persons to whom the Software is furnished to
15 * do so, subject to the following conditions:
16 *
17 * - Redistributions of source code must retain the above copyright notice,
18 * this list of conditions and the following disclaimers.
19 *
20 * - Redistributions in binary form must reproduce the above copyright notice,
21 * this list of conditions and the following disclaimers in the documentation
22 * and/or other materials provided with the distribution.
23 *
24 * - Neither the names of the Luthey-Schulten Group, University of Illinois at
25 * Urbana-Champaign, nor the names of its contributors may be used to endorse or
26 * promote products derived from this Software without specific prior written
27 * permission.
28 *
29 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
32 * THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
33 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
34 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
35 * OTHER DEALINGS WITH THE SOFTWARE.
36 *
37 * Author(s): Elijah Roberts, Tyler M Earnest
38 */
39
40#ifndef LM_DEBUG_H_
41#define LM_DEBUG_H_
42
43#include <string>
44
45namespace lm {
46
49class Print
50{
51 static int _verbosityLevel;
52public:
53 // "Severity"
54 static const int VERBOSE_DEBUG = 10;
55 static const int DEBUG = 9;
56 static const int INFO = 4;
57 static const int WARNING = 3;
58 static const int ERROR = 2;
59 static const int FATAL = 1;
60
65 static void printf(int level, const char * fmt, ...);
66
68 static void printDateTimeString();
69
72 static std::string getDateTimeString();
73
76 static int verbosityLevel() {return _verbosityLevel; }
77
80 static void verbosityLevel(int x) {_verbosityLevel=x; }
81
85 static bool ifPrinted(int x) {return (x <= _verbosityLevel); }
86};
87
88}
89
90#endif
91
Print messages to the console at varying levels of verbosity.
Definition Print.h:50
static const int WARNING
Definition Print.h:57
static void printDateTimeString()
Print the date and time to the console.
Definition Print.cpp:150
static const int INFO
Definition Print.h:56
static int verbosityLevel()
Gets the verbosity level. Lower numbers are higher priority.
Definition Print.h:76
static const int FATAL
Definition Print.h:59
static const int ERROR
Definition Print.h:58
static const int DEBUG
Definition Print.h:55
static const int VERBOSE_DEBUG
Definition Print.h:54
static void verbosityLevel(int x)
Sets the verbosity level. Lower numbers are higher priority.
Definition Print.h:80
static bool ifPrinted(int x)
True if a call to Print::printf(x, ...) would print to stdout.
Definition Print.h:85
static std::string getDateTimeString()
Gets the date and time as a string.
Definition Print.cpp:160
static void printf(int level, const char *fmt,...)
Prints to the console at varying levels of verbosity or "Severity".
Definition Print.cpp:70
Definition Capsule.cpp:46