k1a  1.1
Accelerated functionalities for k1lib
utils.h
Go to the documentation of this file.
1 #pragma once
2 #define PY_SSIZE_T_CLEAN
3 #include <Python.h>
4 
5 #include <fstream>
6 #include <iostream>
7 
8 namespace k1a {
9 
10 extern bool debug;
11 
12 template <class T>
13 void log_print(T s) {
14  std::ofstream f;
15  f.open("/home/kelvin/repos/labs/k1a/logs.txt", std::ios_base::app);
16  f << s;
17  f.close();
18 }
19 
20 template <class T>
21 void log_println(T s) {
22  log_print(s);
23  log_print("\n");
24 }
25 
26 void log_clear();
27 PyObject *k1a_log_clear(PyObject *self, PyObject *args);
28 std::string demangle(const char *name);
29 
30 } // namespace k1a
Definition: funcs.cpp:15
bool debug
Definition: utils.cpp:14
void log_print(T s)
Definition: utils.h:13
PyObject * k1a_log_clear(PyObject *self, PyObject *args)
Definition: utils.cpp:23
void log_println(T s)
Definition: utils.h:21
void log_clear()
Definition: utils.cpp:16
std::string demangle(const char *name)
Demangles C++ signatures.
Definition: utils.cpp:39