ChimeraTK-ApplicationCore
04.06.00
Loading...
Searching...
No Matches
PyLogger.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2
// SPDX-License-Identifier: LGPL-3.0-or-later
3
#pragma once
4
5
#include <pybind11/pybind11.h>
6
// pybind11.h must come first
7
8
#include "
Logger.h
"
9
10
namespace
py
=
pybind11
;
11
12
namespace
ChimeraTK
{
13
14
/********************************************************************************************************************/
15
16
class
PyLogger
{
17
public
:
18
static
void
bind
(
py::module
& mod);
19
};
20
21
/********************************************************************************************************************/
22
28
class
PyLoggerStreamProxy
{
29
public
:
30
PyLoggerStreamProxy
(
Logger::Severity
severity, std::string context)
31
: _severity(severity), _context(std::move(context)) {}
32
33
void
log
(
const
std::string& message) {
ChimeraTK::logger
(_severity, _context) << message; }
34
35
private
:
36
Logger::Severity
_severity;
37
std::string _context;
38
};
39
40
/********************************************************************************************************************/
41
42
}
// namespace ChimeraTK
Logger.h
ChimeraTK::Logger::Severity
Severity
Severity levels used by the Logger.
Definition
Logger.h:27
ChimeraTK::PyLogger
Definition
PyLogger.h:16
ChimeraTK::PyLogger::bind
static void bind(py::module &mod)
Definition
PyLogger.cc:12
ChimeraTK::PyLoggerStreamProxy
PyLoggerStreamProxy.
Definition
PyLogger.h:28
ChimeraTK::PyLoggerStreamProxy::PyLoggerStreamProxy
PyLoggerStreamProxy(Logger::Severity severity, std::string context)
Definition
PyLogger.h:30
ChimeraTK::PyLoggerStreamProxy::log
void log(const std::string &message)
Definition
PyLogger.h:33
ChimeraTK
InvalidityTracer application module.
Definition
spec_dataValidityPropagation.dox:2
ChimeraTK::logger
Logger::StreamProxy logger(Logger::Severity severity, std::string context)
Convenience function to obtain the logger stream.
Definition
Logger.h:124
pybind11
Definition
PyModuleGroup.h:10
pybind11::module
module_ module
Definition
PyModuleGroup.h:12
sources
ChimeraTK-ApplicationCore
Python
bindings
include
PyLogger.h
Generated by
1.9.8