Skip to content

Commit

Permalink
feat(extension): add warning logs on unexpected cases
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Rulleau <[email protected]>
  • Loading branch information
Leiyks committed Feb 20, 2025
1 parent 0086536 commit c8d4485
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions appsec/src/extension/commands_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,14 @@ static void dd_command_process_settings(mpack_node_t root)
if (dd_string_equals_lc(
key_str, key_len, ZEND_STRL("auto_user_instrum"))) {
dd_parse_user_collection_mode_rc(value_str, value_len);
} else {
if (!get_global_DD_APPSEC_TESTING()) {
mlog(dd_log_warning,
"Failed to process user collection setting: "
"unknown key %.*s",
(int)key_len, key_str);
}
return;
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions appsec/src/extension/user_tracking.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ void dd_parse_user_collection_mode_rc(
_user_mode_rc = user_mode_anon;
} else { // If the value is disabled or an unknown value, we disable user ID
// collection
if (!get_global_DD_APPSEC_TESTING()) {
mlog_g(dd_log_warning,
"Unknown or disabled remote config user collection mode: %.*s",
(int)value_len, value);
}
_user_mode_rc = user_mode_disabled;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class asm_features_listener : public listener_base {
public:
explicit asm_features_listener(
std::shared_ptr<dds::service_config> service_config)
: service_config_(std::move(service_config)) {};
: service_config_(std::move(service_config)){};

void init() override;
void on_update(const config &config) override;
Expand Down

0 comments on commit c8d4485

Please sign in to comment.