Ticket #9860: 0001-Trying-to-avoid-junk-log-messsages.patch

File 0001-Trying-to-avoid-junk-log-messsages.patch, 2.1 KB (added by rl1987, 6 years ago)
  • src/or/config.c

    From a579a6b5b4c905e8810660aef3da6a7f2a7a0bcd Mon Sep 17 00:00:00 2001
    From: rl1987 <rl1987@sdf.lonestar.org>
    Date: Mon, 21 Oct 2013 23:53:22 +0300
    Subject: [PATCH] Trying to avoid junk log messsages.
    
    ---
     src/or/config.c | 11 +++++++++--
     src/or/router.c | 12 +++++++++---
     2 files changed, 18 insertions(+), 5 deletions(-)
    
    diff --git a/src/or/config.c b/src/or/config.c
    index 14e8f9a..ec96b82 100644
    a b options_act_reversible(const or_options_t *old_options, char **msg) 
    11511151  if (!running_tor)
    11521152    goto commit;
    11531153
     1154  /* Bail-out if config options haven't changed. */
     1155  if (options && old_options)
     1156    if (config_lines_eq(options->Logs, old_options->Logs)) {
     1157      r = 0;
     1158      goto done;
     1159    }
     1160
    11541161  mark_logs_temp(); /* Close current logs once new logs are open. */
    11551162  logs_marked = 1;
    11561163  if (options_init_logs(options, 0)<0) { /* Configure the tor_log(s) */
    options_act_reversible(const or_options_t *old_options, char **msg) 
    11801187
    11811188  SMARTLIST_FOREACH(replaced_listeners, connection_t *, conn,
    11821189  {
    1183     log_notice(LD_NET, "Closing old %s on %s:%d",
    1184                conn_type_to_string(conn->type), conn->address, conn->port);
     1190    log_info(LD_NET, "Closing old %s on %s:%d",
     1191             conn_type_to_string(conn->type), conn->address, conn->port);
    11851192    connection_close_immediate(conn);
    11861193    connection_mark_for_close(conn);
    11871194  });
  • src/or/router.c

    diff --git a/src/or/router.c b/src/or/router.c
    index 2cc5b16..568bd4c 100755
    a b init_keys(void) 
    920920  tor_free(cp);
    921921  tor_free(keydir);
    922922
    923   log_notice(LD_GENERAL,
    924       "Your Tor server's identity key fingerprint is '%s %s'",
    925       options->Nickname, fingerprint);
     923  static short int already_printed_fp = 0;
     924
     925  if (!already_printed_fp) {
     926    already_printed_fp = 1;
     927    log_notice(LD_GENERAL,
     928         "Your Tor server's identity key fingerprint is '%s %s'",
     929         options->Nickname, fingerprint);
     930  }
     931
    926932  if (!authdir_mode(options))
    927933    return 0;
    928934  /* 6. [authdirserver only] load approved-routers file */