diff --git a/src/dns.c b/src/dns.c index 68963a658..644f3eaac 100644 --- a/src/dns.c +++ b/src/dns.c @@ -175,12 +175,10 @@ void reinit_resolver(Client *client) { EventDel(unrealdns_timeout_hdl); - sendto_ops_and_log("%s requested reinitalization of resolver!", client->name); - sendto_realops("Destroying resolver channel, along with all currently pending queries..."); + unreal_log(ULOG_INFO, "dns", "REINIT_RESOLVER", client, + "$client requested reinitalization of the DNS resolver"); ares_destroy(resolver_channel); - sendto_realops("Initializing resolver again..."); init_resolver(0); - sendto_realops("Reinitalization finished successfully."); } void unrealdns_addreqtolist(DNSReq *r) @@ -407,8 +405,9 @@ void unrealdns_cb_nametoip_link(void *arg, int status, int timeouts, struct host !(ip = inetntop(r->ipv6 ? AF_INET6 : AF_INET, he->h_addr_list[0], ipbuf, sizeof(ipbuf)))) { /* Illegal response -- fatal */ - sendto_ops_and_log("Unable to resolve hostname '%s', when trying to connect to server %s.", - r->name, r->linkblock->servername); + unreal_log(ULOG_ERROR, "link", "LINK_ERROR_RESOLVING", NULL, + "Unable to resolve hostname $link_block.hostname, when trying to connect to server $link_block.", + log_data_link_block(r->linkblock)); unrealdns_freeandremovereq(r); return; } diff --git a/src/modules/chanmodes/floodprot.c b/src/modules/chanmodes/floodprot.c index 42b835706..854ec70a7 100644 --- a/src/modules/chanmodes/floodprot.c +++ b/src/modules/chanmodes/floodprot.c @@ -1080,8 +1080,10 @@ void floodprottimer_add(Channel *channel, char mflag, time_t when) { if (strlen(chp->timers_running)+1 >= sizeof(chp->timers_running)) { - sendto_ops_and_log("floodprottimer_add: too many timers running for %s (%s)!!!", - channel->name, chp->timers_running); + unreal_log(ULOG_WARNING, "flood", "BUG_FLOODPROTTIMER_ADD", NULL, + "[BUG] floodprottimer_add: too many timers running for $channel ($timers_running)", + log_data_channel("channel", channel), + log_data_string("timers_running", chp->timers_running)); return; } strccat(chp->timers_running, mflag); /* bounds already checked ^^ */ diff --git a/src/modules/history_backend_mem.c b/src/modules/history_backend_mem.c index 0a77cdf16..01777db70 100644 --- a/src/modules/history_backend_mem.c +++ b/src/modules/history_backend_mem.c @@ -1504,9 +1504,10 @@ char *hbm_history_filename(HistoryLogObject *h) #define WARN_WRITE_ERROR(fname) \ do { \ - sendto_ops_and_log("[history] Error writing to temporary database file " \ - "'%s': %s (DATABASE NOT SAVED)", \ - fname, unrealdb_get_error_string()); \ + unreal_log(ULOG_ERROR, "history", "HISTORYDB_FILE_WRITE_ERROR", NULL, \ + "[historydb] Error writing to temporary database file $filename: $system_error", \ + log_data_string("filename", fname), \ + log_data_string("system_error", unrealdb_get_error_string())); \ } while(0) #define W_SAFE(x) \ @@ -1584,7 +1585,7 @@ static int hbm_write_db(HistoryLogObject *h) #endif if (rename(tmpfname, realfname) < 0) { - sendto_ops_and_log("[history] Error renaming '%s' to '%s': %s (HISTORY NOT SAVED)", + config_error("[history] Error renaming '%s' to '%s': %s (HISTORY NOT SAVED)", tmpfname, realfname, strerror(errno)); return 0; } diff --git a/src/send.c b/src/send.c index 34b93f043..c5fbb0cff 100644 --- a/src/send.c +++ b/src/send.c @@ -79,8 +79,14 @@ int dead_socket(Client *to, char *notice) return -1; /* don't overwrite & don't send multiple times */ if (!IsUser(to) && !IsUnknown(to) && !IsClosing(to)) - sendto_ops_and_log("Link to server %s (%s) closed: %s", - to->name, to->ip?to->ip:"", notice); + { + /* Looks like a duplicate error message to me? + * If so, remove it here. + */ + unreal_log(ULOG_ERROR, "link", "LINK_CLOSING", to, + "Link to server $client.detail closed: $reason", + log_data_string("reason", notice)); + } safe_strdup(to->local->error_str, notice); return -1; } diff --git a/src/socket.c b/src/socket.c index 5bf6f20d9..61c49c764 100644 --- a/src/socket.c +++ b/src/socket.c @@ -470,7 +470,8 @@ void completed_connection(int fd, int revents, void *data) if (!aconf) { - sendto_ops_and_log("Lost configuration for %s", get_client_name(client, FALSE)); + unreal_log(ULOG_ERROR, "link", "BUG_LOST_CONFIGURATION_ON_CONNECT", client, + "Lost configuration while connecting to $client.details"); return; }