Nebula
Loading...
Searching...
No Matches
tyti::pylog Namespace Reference

Namespaces

namespace  detail
 

Functions

template<typename T >
void redirect_stdout (T t)
 redirects sys.stdout
 
template<typename T >
void redirect_stderr (T t)
 

Function Documentation

◆ redirect_stderr()

template<typename T >
void tyti::pylog::redirect_stderr ( T t)
inline

◆ redirect_stdout()

template<typename T >
void tyti::pylog::redirect_stdout ( T t)
inline

redirects sys.stdout

Whenever sys.stdout.write is called, call the given function instead. Given function has to be the signature "void (const char*)"

Preconditions: Python has to be initialized. Calling thread has to hold the GIL. (in case of multi threading)

Exceptions: Maybe a PyErr occurs. This must be handled by the user.

Parameters
tcallbacl function of type "void (const char*)"