summaryrefslogtreecommitdiffstats
path: root/src/log.watch.cc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/log.watch.cc21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/log.watch.cc b/src/log.watch.cc
index e90b2eb..c4e5826 100644
--- a/src/log.watch.cc
+++ b/src/log.watch.cc
@@ -39,6 +39,7 @@
#include "logfile_sub_source.cfg.hh"
#include "readline_highlighters.hh"
#include "sql_util.hh"
+#include "sqlitepp.hh"
namespace lnav {
namespace log {
@@ -50,6 +51,8 @@ struct compiled_watch_expr {
};
struct expressions : public lnav_config_listener {
+ expressions() : lnav_config_listener(__FILE__) {}
+
void reload_config(error_reporter& reporter) override
{
auto& lnav_db = injector::get<auto_sqlite3&>();
@@ -98,9 +101,7 @@ struct expressions : public lnav_config_listener {
}
}
- void unload_config() override {
- this->e_watch_exprs.clear();
- }
+ void unload_config() override { this->e_watch_exprs.clear(); }
std::map<std::string, compiled_watch_expr> e_watch_exprs;
};
@@ -192,7 +193,7 @@ eval_with(logfile& lf, logfile::iterator ll)
sqlite3_bind_text(stmt,
lpc + 1,
filename.c_str(),
- filename.length(),
+ filename.native().length(),
SQLITE_STATIC);
continue;
}
@@ -201,7 +202,7 @@ eval_with(logfile& lf, logfile::iterator ll)
sqlite3_bind_text(stmt,
lpc + 1,
filename.c_str(),
- filename.length(),
+ filename.native().length(),
SQLITE_STATIC);
continue;
}
@@ -230,15 +231,11 @@ eval_with(logfile& lf, logfile::iterator ll)
continue;
}
if (strcmp(name, ":log_opid") == 0) {
- auto opid_attr_opt = get_string_attr(sa, logline::L_OPID);
- if (opid_attr_opt) {
- const auto& sar
- = opid_attr_opt.value().saw_string_attr->sa_range;
-
+ if (values.lvv_opid_value) {
sqlite3_bind_text(stmt,
lpc + 1,
- values.lvv_sbr.get_data_at(sar.lr_start),
- sar.length(),
+ values.lvv_opid_value->c_str(),
+ values.lvv_opid_value->length(),
SQLITE_STATIC);
} else {
sqlite3_bind_null(stmt, lpc + 1);