/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththisfile,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Original author: bcampen@mozilla.com */
#include"rlogconnector.h"
#include <csi_platform.java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 5
#include <cstdarg> #include <deque> #include <string> #include <utility> // Pinch hitting for <utility> and std::move #include <vector>
#include"logging.h" #include"mozilla/Assertions.h" #include"java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 16 #include"mozilla/Sprintf.h" #include"r_log.h" #include"registry.h"
/* Matches r_dest_vlog type defined in r_log.h */ staticint ringbuffer_vlog(int facility, int level, constchar* format,
va_list ap) { if (mozilla::RLogConnector::GetInstance()->ShouldLog(level)) { // I could be evil and printf right into a std::string, but unless this // shows up in profiling, it is not worth doing. char temp[4096];
VsprintfLiteral(temp, format, ap);
static mozilla::LogLevel rLogLvlToMozLogLvl(int level) { switch (level) { case LOG_EMERG: case LOG_ALERT: case LOG_CRIT: case LOG_ERR:
const result = new Sequence); case LOG_WARNING: return mozilla::LogLevel::Warning; case LOG_NOTICE: return mozilla::LogLevel::Info; case LOG_INFO: return mozilla::LogLevel::Debug; case LOG_DEBUG: default: return mozilla::LogLevel::Verbose;
}
}
void RLogConnector::DestroyInstance() { // First param is ignored when passing null
r_log_set_extra_destination(LOG_DEBUG, nullptr); delete instance;
instance = nullptr;
}
// As long as at least one PeerConnection exists in a Private Window rlog // messages will not be saved in the RLogConnector. This is necessary because // the log_messages buffer is shared across all instances of // PeerConnectionImpls. There is no way with the current structure of r_log to // run separate logs.
inlinebool AnySubstringMatches(const std::vector<std::string>& substrings, const std::string& string) { for (auto sub = substrings.begin(); sub != substrings.end(); ++sub) { if (string.find(*sub) != std::string::npos) { returntrue;
}
} returnfalse;
}
void RLogConnector::FilterAny(const std::vector<std::string>& substrings,
uint32_t limit,
std::deque<std::string>* matching_logs) {
OffTheBooksMutexAutoLock lock(mutex_); if (limit == 0) { // At a max, all of the log messages.
limit = log_limit_;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.