Compare commits

..

No commits in common. "4db64d4da6a992d87aa1d6448e3e38cb2717f30a" and "562aa7e643a66c9d7a54a0d0ef9b50b1c5253697" have entirely different histories.

4 changed files with 5 additions and 45 deletions

View File

@ -43,7 +43,7 @@ void event_loop(ImFont* monospace_font, Config& active_config, LogcatThread& log
check_for_logcat_items(logcat_thread, active_config, logcat_entries, filtered_logcat_entry_offsets); check_for_logcat_items(logcat_thread, active_config, logcat_entries, filtered_logcat_entry_offsets);
#ifndef NDEBUG #ifndef NDEBUG
debug_window(logcat_thread, active_config, logcat_entries, filtered_logcat_entry_offsets); debug_window(logcat_thread);
#endif #endif
if (show_settings_window) { if (show_settings_window) {

View File

@ -136,9 +136,9 @@ bool StringFilter::_match_regex(const LogcatEntry& entry) const {
matched = this->_regex->match(str ? str->data() : "", 1, pmatch, eflags); matched = this->_regex->match(str ? str->data() : "", 1, pmatch, eflags);
if (this->exact_match) { if (this->exact_match) {
matched = matched && pmatch[0].rm_so == 0 && (str matched = matched && pmatch[0].rm_so == 0 && str
? static_cast<size_t>(pmatch[0].rm_eo) == str->size() ? static_cast<size_t>(pmatch[0].rm_eo) == str->size()
: pmatch[0].rm_eo == 0); : pmatch[0].rm_so == 0;
} }
return matched; return matched;
} }

View File

@ -2,14 +2,10 @@
#include "../myimconfig.h" #include "../myimconfig.h"
#include "../log.h" #include "../log.h"
#include "../config.h"
#include "../filters.h"
#include "../logcat_entry.h"
#include "../logcat_thread.h" #include "../logcat_thread.h"
#include "debug.h" #include "debug.h"
void debug_window(LogcatThread& logcat_thread, const Config& active_config, void debug_window(LogcatThread& logcat_thread) {
std::vector<LogcatEntry>& logcat_entries, std::vector<size_t>& filtered_logcat_entry_offsets) {
static bool show_demo_window = false; static bool show_demo_window = false;
static size_t add_log_entry_presses = 1; static size_t add_log_entry_presses = 1;
static bool log_entry_every_second = false; static bool log_entry_every_second = false;
@ -53,36 +49,5 @@ void debug_window(LogcatThread& logcat_thread, const Config& active_config,
} }
} }
ImGui::Separator();
auto add_logcat_entry = [&](LogcatEntry logcat_entry) {
logcat_entries.push_back(std::move(logcat_entry));
if (matches(logcat_entries.back(), active_config.filters, active_config.exclusions)) {
filtered_logcat_entry_offsets.push_back(logcat_entries.size() - 1);
}
};
if (ImGui::Button("Add test entry (w/ user)")) {
add_logcat_entry({
.buffer = Buffer::Main,
.time = time(nullptr),
.user = "blankie",
.pid = 69,
.tid = 420,
.priority = Priority::Error,
.tag = "blanket, inc.",
.message = "Failed to make blanket",
});
}
if (ImGui::Button("Add test entry (w/o user)")) {
add_logcat_entry({
.buffer = Buffer::Crash,
.time = time(nullptr),
.pid = 420,
.tid = 69,
.priority = Priority::Fatal,
.tag = "blanket, inc.",
.message = "Failed to invent blankets",
});
}
ImGui::End(); ImGui::End();
} }

View File

@ -1,10 +1,5 @@
#pragma once #pragma once
#include <vector>
struct Config; // forward declaration from ../config.h
struct LogcatEntry; // forward declaration from ../logcat_entry.h
class LogcatThread; // forward declaration from ../logcat_thread.h class LogcatThread; // forward declaration from ../logcat_thread.h
void debug_window(LogcatThread& logcat_thread, const Config& active_config, void debug_window(LogcatThread& logcat_thread);
std::vector<LogcatEntry>& logcat_entries, std::vector<size_t>& filtered_logcat_entry_offsets);