CppADCodeGen 2.4.3
A C++ Algorithmic Differentiation Package with Source Code Generation
Loading...
Searching...
No Matches
simple_logger.hpp
1#ifndef CPPAD_CG_SIMPLE_LOGGER_INCLUDED
2#define CPPAD_CG_SIMPLE_LOGGER_INCLUDED
3/* --------------------------------------------------------------------------
4 * CppADCodeGen: C++ Algorithmic Differentiation with Source Code Generation:
5 * Copyright (C) 2016 Ciengis
6 *
7 * CppADCodeGen is distributed under multiple licenses:
8 *
9 * - Eclipse Public License Version 1.0 (EPL1), and
10 * - GNU General Public License Version 3 (GPL3).
11 *
12 * EPL1 terms and conditions can be found in the file "epl-v10.txt", while
13 * terms and conditions for the GPL3 can be found in the file "gpl3.txt".
14 * ----------------------------------------------------------------------------
15 * Author: Joao Leal
16 */
17
18namespace CppAD {
19namespace cg {
20
25protected:
26 // verbosity level
27 Verbosity verbosity_;
28 // output stream used for logging
29 std::ostream* log_;
30public:
31
35 inline SimpleLogger() :
36 verbosity_(Verbosity::None),
37 log_(&std::cout) {
38 }
39
40 inline virtual ~SimpleLogger() {
41 }
42
43 inline std::ostream& log() const {
44 return *log_;
45 }
46
47 inline void setLog(std::ostream& out) {
48 log_ = &out;
49 }
50
51 inline void setVerbosity(Verbosity verbosity) {
52 verbosity_ = verbosity;
53 }
54
55 inline Verbosity getVerbosity() const {
56 return verbosity_;
57 }
58
59};
60
61} // END cg namespace
62} // END CppAD namespace
63
64#endif
65