ViennaSHE 1.3.0
Free open-source semiconductor device simulator using spherical harmonics expansions techniques.
logtest.cpp
Go to the documentation of this file.
1/* ============================================================================
2 Copyright (c) 2011-2022, Institute for Microelectronics,
3 Institute for Analysis and Scientific Computing,
4 TU Wien.
5
6 -----------------
7 ViennaSHE - The Vienna Spherical Harmonics Expansion Boltzmann Solver
8 -----------------
9
10 http://viennashe.sourceforge.net/
11
12 License: MIT (X11), see file LICENSE in the base directory
13=============================================================================== */
14
21#include <cstdlib>
22#include <iostream>
23
24#include "viennashe/log/log.hpp"
25
26using namespace viennashe;
27
28struct my_key_enabled
29{
30 enum { enabled = true };
31};
32
33struct my_key_disabled
34{
35 enum { enabled = false };
36};
37
38int main()
39{
40 std::cout << " ** BEGIN OF TEST **" << std::endl << std::endl;
41
42 std::cout << "LOGTEST ... this is per stdout using fprintf ..." << std::endl;
43 std::cout << "Testing error, warn, info, debug now: " << std::endl << std::endl;
44
45 log::error() << "ERROR VISIBLE " << std::endl;
46 log::warn() << "WARN VISIBLE " << std::endl;
47 log::info() << "INFO VISIBLE " << std::endl;
48 log::debug() << "DEBUG NOT VISIBLE " << std::endl;
49
50 log::error<my_key_enabled>() << "KEY: ERROR VISIBLE " << std::endl;
51 log::warn<my_key_enabled>() << "KEY: WARN VISIBLE " << std::endl;
52 log::info<my_key_enabled>() << "KEY: INFO VISIBLE " << std::endl;
53 log::debug<my_key_enabled>() << "KEY: DEBUG NOT VISIBLE " << std::endl;
54
55 log::error<my_key_disabled>() << "KEY: ERROR NOT VISIBLE " << std::endl;
56 log::warn<my_key_disabled>() << "KEY: WARN NOT VISIBLE " << std::endl;
57 log::info<my_key_disabled>() << "KEY: INFO NOT VISIBLE " << std::endl;
58 log::debug<my_key_disabled>() << "KEY: DEBUG NOT VISIBLE " << std::endl;
59
60 std::cout << std::endl;
61 std::cout << " ** END OF TEST **" << std::endl;
62
63 return EXIT_SUCCESS;
64}
65
A logging facility providing fine-grained control over logging in ViennaSHE.
logger< true > error()
Used to log errors. The logging level is logERROR.
Definition: log.hpp:301
logger< true > debug()
Used to log debug output. The logging level is logDEBUG.
Definition: log.hpp:309
logger< true > warn()
Used to log warnings. The logging level is logWARNING.
Definition: log.hpp:303
logger< true > info()
Used to log infos. The logging level is logINFO.
Definition: log.hpp:307
The main ViennaSHE namespace. All functionality resides inside this namespace.
Definition: accessors.hpp:40
int main()
Definition: resistor1d-c.c:108