ATLAS Offline Software
Loading...
Searching...
No Matches
PyLogger.h
Go to the documentation of this file.
1// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7// $Id: PyLogger.h,v 1.1 2007-12-15 06:54:27 ssnyder Exp $
8
15
16
17#ifndef ROOTUTILS_PYLOGGER_H
18#define ROOTUTILS_PYLOGGER_H
19
20
21#ifdef _POSIX_C_SOURCE
22# undef _POSIX_C_SOURCE
23#endif
24#include "Python.h"
25
26#include "RootUtils/ILogger.h"
27
28
29namespace RootUtils {
30
31
36 : public RootUtils::ILogger
37{
38public:
47 PyLogger (PyObject* debugfn, PyObject* errorfn);
48
49
51 ~PyLogger();
52
53
58 virtual void debug (const char* msg);
59
60
65 virtual void error (const char* msg);
66
67
68private:
76 static void call (PyObject* fn, const char* msg);
77
78
81
84};
85
86
87} // namespace RootUtils
88
89
90#endif // not ROOTUTILS_PYLOGGER_H
Very simple interface for writing log messages.
_object PyObject
const bool debug
Very simple interface for writing log messages.
Definition ILogger.h:34
~PyLogger()
Destructor.
Definition PyLogger.cxx:39
PyObject * m_errorfn
The error message function.
Definition PyLogger.h:83
PyLogger(PyObject *debugfn, PyObject *errorfn)
Constructor.
Definition PyLogger.cxx:27
static void call(PyObject *fn, const char *msg)
Common code to call Python callback.
Definition PyLogger.cxx:73
PyObject * m_debugfn
The debug message function.
Definition PyLogger.h:80
MsgStream & msg
Definition testRead.cxx:32