Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/proxy/logging/Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ class Log
static void init_fields();
static void load_config();

// Register a field in both global_field_list and field_symbol_hash, keyed by
// its own symbol so the two can never drift apart.
static void register_field(LogField *field);

static bool
transaction_logging_enabled()
{
Expand Down
2 changes: 1 addition & 1 deletion include/proxy/logging/LogField.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class LogFieldList
~LogFieldList();

void clear();
void add(LogField *field, bool copy = true);
void add(LogField *field);
void remove(LogField *field);
Comment thread
masaori335 marked this conversation as resolved.
LogField *find_by_name(const char *name) const;
LogField *find_by_symbol(const char *symbol) const;
Expand Down
3 changes: 1 addition & 2 deletions src/api/InkAPI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9161,8 +9161,7 @@ TSLogFieldRegister(std::string_view name, std::string_view symbol, TSLogType typ
name.data(), symbol.data(), static_cast<LogField::Type>(type),
[marshal_cb = std::move(marshal_cb)](void *sm, char *buf) -> int { return marshal_cb(reinterpret_cast<TSHttpTxn>(sm), buf); },
unmarshal_cb);
Log::global_field_list.add(field, false);
Log::field_symbol_hash.emplace(symbol.data(), field);
Log::register_field(field);

return TS_SUCCESS;
}
Expand Down
Loading