1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-07 23:23:12 +02:00

For remotely received log messages (via SLOG) show the original server name

as sender in the NOTICE, just like we used to do in the past.
This commit is contained in:
Bram Matthys
2021-08-12 17:07:12 +02:00
parent 0e5f5f7374
commit 9a2e8613ae
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -1102,7 +1102,7 @@ extern char *log_type_valtostring(LogType v);
#endif
extern void do_unreal_log(LogLevel loglevel, char *subsystem, char *event_id, Client *client, char *msg, ...) __attribute__((format(printf,5,0)));
extern void do_unreal_log_raw(LogLevel loglevel, char *subsystem, char *event_id, Client *client, char *msg, ...);
extern void do_unreal_log_internal_from_remote(LogLevel loglevel, char *subsystem, char *event_id, MultiLine *msg, char *json_serialized);
extern void do_unreal_log_internal_from_remote(LogLevel loglevel, char *subsystem, char *event_id, MultiLine *msg, char *json_serialized, Client *from_server);
extern LogData *log_data_string(const char *key, const char *str);
extern LogData *log_data_char(const char *key, const char c);
extern LogData *log_data_integer(const char *key, int64_t integer);
+5 -5
View File
@@ -1269,7 +1269,7 @@ char *log_to_snomask(LogLevel loglevel, char *subsystem, char *event_id)
#define COLOR_NONE "\xf"
#define COLOR_DARKGREY "\00314"
/** Do the actual writing to log files */
void do_unreal_log_opers(LogLevel loglevel, char *subsystem, char *event_id, MultiLine *msg, char *json_serialized)
void do_unreal_log_opers(LogLevel loglevel, char *subsystem, char *event_id, MultiLine *msg, char *json_serialized, Client *from_server)
{
Client *client;
char *snomask_destinations;
@@ -1330,7 +1330,7 @@ void do_unreal_log_opers(LogLevel loglevel, char *subsystem, char *event_id, Mul
snprintf(subsystem_and_event_id, sizeof(subsystem_and_event_id), "%s%s.%s%s%s",
COLOR_DARKGREY, subsystem, event_id, m->next?"+":"", COLOR_NONE);
sendto_one(client, mtags_loop, ":%s NOTICE %s :%s %s[%s]%s %s",
me.name, client->name,
from_server->name, client->name,
subsystem_and_event_id,
log_level_irc_color(loglevel), log_level_valtostring(loglevel), COLOR_NONE,
m->line);
@@ -1522,7 +1522,7 @@ void do_unreal_log_internal(LogLevel loglevel, char *subsystem, char *event_id,
do_unreal_log_disk(loglevel, subsystem, event_id, mmsg, json_serialized);
/* And the ircops stuff */
do_unreal_log_opers(loglevel, subsystem, event_id, mmsg, json_serialized);
do_unreal_log_opers(loglevel, subsystem, event_id, mmsg, json_serialized, &me);
do_unreal_log_remote(loglevel, subsystem, event_id, mmsg, json_serialized);
@@ -1536,7 +1536,7 @@ void do_unreal_log_internal(LogLevel loglevel, char *subsystem, char *event_id,
}
void do_unreal_log_internal_from_remote(LogLevel loglevel, char *subsystem, char *event_id,
MultiLine *msg, char *json_serialized)
MultiLine *msg, char *json_serialized, Client *from_server)
{
if (unreal_log_recursion_trap)
return;
@@ -1546,7 +1546,7 @@ void do_unreal_log_internal_from_remote(LogLevel loglevel, char *subsystem, char
do_unreal_log_disk(loglevel, subsystem, event_id, msg, json_serialized);
/* And the ircops stuff */
do_unreal_log_opers(loglevel, subsystem, event_id, msg, json_serialized);
do_unreal_log_opers(loglevel, subsystem, event_id, msg, json_serialized, from_server);
unreal_log_recursion_trap = 0;
}
+1 -1
View File
@@ -157,7 +157,7 @@ CMD_FUNC(cmd_slog)
json_serialized = json_dumps(j, JSON_COMPACT);
if (json_serialized)
do_unreal_log_internal_from_remote(loglevel, subsystem, event_id, mmsg, json_serialized);
do_unreal_log_internal_from_remote(loglevel, subsystem, event_id, mmsg, json_serialized, client);
/* Broadcast to the other servers */
sendto_server(client, 0, 0, recv_mtags, ":%s SLOG %s %s %s :%s",