File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -502,6 +502,12 @@ class LogSqliteDatabase : public IELogDatabaseEngine
502502 **/
503503 bool resetFilterMask (ITEM_ID instId = NEService::TARGET_ALL);
504504
505+ /* *
506+ * \brief Disables the logging priority filter mask of the specified instance ID or for all instances.
507+ * Returns true if operation succeeded.
508+ **/
509+ bool disableFilterMask (ITEM_ID instId = NEService::TARGET_ALL);
510+
505511// ////////////////////////////////////////////////////////////////////////
506512// Hidden methods
507513// ////////////////////////////////////////////////////////////////////////
Original file line number Diff line number Diff line change @@ -388,6 +388,16 @@ namespace
388388 " UPDATE filter_rules SET log_mask = 1008;"
389389 };
390390
391+ constexpr std::string_view _sqlDisableFilterScopes
392+ {
393+ " UPDATE filter_rules SET log_mask = 0 WHERE target_id = ?;"
394+ };
395+
396+ constexpr std::string_view _sqlDisableFilterScopesAll
397+ {
398+ " UPDATE filter_rules SET log_mask = 0;"
399+ };
400+
391401 constexpr std::string_view _sqlDropTable
392402 {
393403 " DROP TABLE IF EXISTS %s;"
@@ -1400,6 +1410,25 @@ bool LogSqliteDatabase::resetFilterMask(ITEM_ID instId /*= NEService::TARGET_ALL
14001410 return stmt.execute ();
14011411}
14021412
1413+ bool LogSqliteDatabase::disableFilterMask (ITEM_ID instId)
1414+ {
1415+ if (tableExists (" filter_rules" , _temp) == false )
1416+ return false ;
1417+
1418+ SqliteStatement stmt (mDatabase );
1419+ if (instId == NEService::TARGET_ALL)
1420+ {
1421+ VERIFY (stmt.prepare (_sqlDisableFilterScopesAll));
1422+ }
1423+ else
1424+ {
1425+ VERIFY (stmt.prepare (_sqlDisableFilterScopes));
1426+ stmt.bindUint64 (0 , instId);
1427+ }
1428+
1429+ return stmt.execute ();
1430+ }
1431+
14031432bool LogSqliteDatabase::tableExists (const char * table, const char * master /* = nullptr*/ )
14041433{
14051434 bool result{ false };
You can’t perform that action at this time.
0 commit comments