Skip to content

Commit

Permalink
update Logger config statement so it has parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
berthubert committed Apr 12, 2024
1 parent 61edd48 commit a07bb4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ supplied a user name and a password, which will be checked using basic auth.
If you load / in a webserver you get a somewhat nice dashboard with metrics.

## Datalogger
If you add `Logger("stats.sqlite3")`, simplomon will populate a SQLite
If you add `Logger{filename="stats.sqlite3"}`, simplomon will populate a SQLite
database (in the file './stats.sqlite3') with lots of interesting metadata,
one table per checker kind.

Expand Down
6 changes: 4 additions & 2 deletions luabridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ void initLua()

});

g_lua.set_function("Logger", [&](const std::string& dbname) {
g_sqlw = std::make_unique<SQLiteWriter>(dbname);
g_lua.set_function("Logger", [&](sol::table data) {
checkLuaTable(data, {"filename"});

g_sqlw = std::make_unique<SQLiteWriter>((string)data["filename"]);
});

g_lua.set_function("doIPv6", [&](bool ipv6) {
Expand Down

0 comments on commit a07bb4e

Please sign in to comment.