ppap4lmp  0.7.2
message.cpp
Go to the documentation of this file.
1 
8 #include <alias/pybind.h>
9 
10 #include "message.h"
11 
12 namespace ut = utils;
13 
14 bool ToF_LOGGING = false;
15 
16 /* ------------------------------------------------------------------ */
17 
19  const Str &msg)
20 {
21  #pragma omp critical (pyprint)
22  {
23  py::print(msg);
24  }
25 }
26 
27 /* ------------------------------------------------------------------ */
28 
29 void ut::log(
30  const Str &msg)
31 {
32  if (ToF_LOGGING)
33  {
34  ut::_message(msg);
35  }
36 }
37 
38 /* ------------------------------------------------------------------ */
39 
41  const Str &msg)
42 {
43  ut::_message("WARNING - " + msg);
44 }
45 
46 /* ------------------------------------------------------------------ */
47 
49  bool input)
50 {
51  ToF_LOGGING = input;
52 }
void _message(const Str &msg)
Print to standard output.
Definition: message.cpp:18
This file has definitions of messaging functions.
std::string Str
Str is an alias for string.
Definition: std.h:21
void warning(const Str &msg)
Waning with a message.
Definition: message.cpp:40
void log(const Str &msg)
Logging a message.
Definition: message.cpp:29
Namespace for utility functions.
Definition: join.h:14
void log_switch(bool input)
Switch on/off logging.
Definition: message.cpp:48
This file includes pybind11 and defines an alias for the namespace pybind11.