aboutsummaryrefslogtreecommitdiff
path: root/external/easylogging++/easylogging++.cc
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-11-11 21:34:37 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-11-27 13:55:21 +0000
commit721aacd88e780b30416deb66a68b87da8fe244ae (patch)
tree720cabb6fcd8c55ea018d4c6dc06a9a87631856d /external/easylogging++/easylogging++.cc
parentRevert "easylogging++: make the logger handle early/late logging" (diff)
downloadmonero-721aacd88e780b30416deb66a68b87da8fe244ae.tar.xz
easylogging++: faster access to logging
Turns out getting the global shared_ptr hits the profile, and passing it around still keeps it at close to ~1% CPU, which is too much for mostly silent logging. Leak the object instead, which is even safer for late logging.
Diffstat (limited to 'external/easylogging++/easylogging++.cc')
-rw-r--r--external/easylogging++/easylogging++.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/external/easylogging++/easylogging++.cc b/external/easylogging++/easylogging++.cc
index 81179b0a3..c24fb80cf 100644
--- a/external/easylogging++/easylogging++.cc
+++ b/external/easylogging++/easylogging++.cc
@@ -2191,6 +2191,12 @@ void VRegistry::setFromArgs(const base::utils::CommandLineArgs* commandLineArgs)
# define ELPP_DEFAULT_LOGGING_FLAGS 0x0
#endif // !defined(ELPP_DEFAULT_LOGGING_FLAGS)
// Storage
+el::base::type::StoragePointer &el::base::Storage::getELPP()
+{
+ if (!el::base::elStorage)
+ el::base::elStorage = new el::base::Storage(el::LogBuilderPtr(new el::base::DefaultLogBuilder()));
+ return el::base::elStorage;
+}
#if ELPP_ASYNC_LOGGING
Storage::Storage(const LogBuilderPtr& defaultLogBuilder, base::IWorker* asyncDispatchWorker) :
#else