Kagome
Polkadot Runtime Engine in C++17
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
profiling_logger.hpp
Go to the documentation of this file.
1
6
#ifndef KAGOME_CORE_LOG_PROFILING_LOGGER_HPP
7
#define KAGOME_CORE_LOG_PROFILING_LOGGER_HPP
8
9
#include "
log/logger.hpp
"
10
11
namespace
kagome::log
{
12
extern
Logger
profiling_logger
;
13
}
14
15
#ifdef KAGOME_PROFILING
16
17
#include "
clock/impl/clock_impl.hpp
"
18
19
#define KAGOME_PROFILE_START(scope) \
20
auto _profiling_start_##scope = ::kagome::clock::SteadyClockImpl{}.now();
21
22
#define KAGOME_PROFILE_END(scope) \
23
auto _profiling_end_##scope = ::kagome::clock::SteadyClockImpl{}.now(); \
24
SL_DEBUG(::kagome::log::profiling_logger, \
25
"{} took {} ms", \
26
#scope, \
27
::std::chrono::duration_cast<::std::chrono::milliseconds>( \
28
_profiling_end_##scope - _profiling_start_##scope) \
29
.count());
30
31
#else
32
33
#define KAGOME_PROFILE_START(scope)
34
#define KAGOME_PROFILE_END(scope)
35
36
#endif
37
38
#endif // KAGOME_CORE_LOG_PROFILING_LOGGER_HPP
kagome::log::profiling_logger
Logger profiling_logger
Definition:
profiling_logger.cpp:9
logger.hpp
kagome::log::Logger
std::shared_ptr< soralog::Logger > Logger
Definition:
logger.hpp:23
clock_impl.hpp
kagome::log
Definition:
configurator.cpp:8
core
log
profiling_logger.hpp
Generated by
1.8.11