Commit 7fcceb2c authored by Nick Mathewson's avatar Nick Mathewson 🦀
Browse files

r12074@catbus: nickm | 2007-03-04 15:11:43 -0500

 Make all LD_BUG log messsages get prefixed with "Bug: ".  Remove manually-generated "Bug: "s from log-messages.  (Apparently, we remembered to add them about 40% of the time.)


svn:r9733
parent 654924df
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3,6 +3,10 @@ Changes in version 0.2.0.1-alpha - 2007-??-??
    - Make autoconf search for libevent and openssl consistently.
    - Update deprecated macros in configure.in

  o Minor features (logging):
    - Always prepend "Bug: " to any log message about a bug.


Changes in version 0.1.2.10-rc - 2007-03-??
  o Major bugfixes (Windows):
    - Do not load the NT services library functions (which may not exist)
+1 −1
Original line number Diff line number Diff line
@@ -424,7 +424,7 @@ Future version:
  - when we hit a funny error from a dir request (eg 403 forbidden),
    but tor is working and happy otherwise, and we haven't seen many
    such errors recently, then don't warn about it.
  - LD_BUG log messages could prepend "Bug: " automatically, so we don't
  o LD_BUG log messages could prepend "Bug: " automatically, so we don't
    have to try to remember to.
  - More consistent error checking in router_parse_entry_from_string().
    I can say "banana" as my bandwidthcapacity, and it won't even squeak.
+9 −4
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ static void close_log(logfile_t *victim);
 * <b>buf_len</b> character buffer in <b>buf</b>.
 */
static INLINE size_t
_log_prefix(char *buf, size_t buf_len, int severity)
_log_prefix(char *buf, size_t buf_len, int severity, uint32_t domain)
{
  time_t t;
  struct timeval now;
@@ -144,7 +144,7 @@ log_tor_version(logfile_t *lf, int reset)
    /* We are resetting, but we aren't at the start of the file; no
     * need to log again. */
    return 0;
  n = _log_prefix(buf, sizeof(buf), LOG_NOTICE);
  n = _log_prefix(buf, sizeof(buf), LOG_NOTICE, LD_GENERAL);
  tor_snprintf(buf+n, sizeof(buf)-n,
               "Tor %s opening %slog file.\n", VERSION, is_new?"new ":"");
  if (fputs(buf, lf->file) == EOF ||
@@ -170,7 +170,7 @@ format_msg(char *buf, size_t buf_len,
  tor_assert(buf_len >= 2); /* prevent integer underflow */
  buf_len -= 2; /* subtract 2 characters so we have room for \n\0 */

  n = _log_prefix(buf, buf_len, severity);
  n = _log_prefix(buf, buf_len, severity, domain);
  end_of_prefix = buf+n;

  if (funcname && should_log_function_name(domain, severity)) {
@@ -181,6 +181,11 @@ format_msg(char *buf, size_t buf_len,
      n += r;
  }

  if (domain == LD_BUG && buf_len-n > 6) {
    memcpy(buf+n, "Bug: ", 6);
    n += 5;
  }

  r = tor_vsnprintf(buf+n,buf_len-n,format,ap);
  if (r < 0) {
    /* The message was too long; overwrite the end of the buffer with
+1 −1
Original line number Diff line number Diff line
@@ -1242,7 +1242,7 @@ write_str_to_file(const char *fname, const char *str, int bin)
#ifdef MS_WINDOWS
  if (!bin && strchr(str, '\r')) {
    log_warn(LD_BUG,
             "Bug: we're writing a text string that already contains a CR.");
             "We're writing a text string that already contains a CR.");
  }
#endif
  return write_bytes_to_file(fname, str, strlen(str), bin);
+4 −4
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ get_unique_circ_id_by_conn(or_connection_t *conn)

  tor_assert(conn);
  if (conn->circ_id_type == CIRC_ID_TYPE_NEITHER) {
    log_warn(LD_BUG, "Bug: Trying to pick a circuit ID for a connection from "
    log_warn(LD_BUG, "Trying to pick a circuit ID for a connection from "
             "a client with no identity.");
    return 0;
  }
@@ -803,12 +803,12 @@ circuit_init_cpath_crypto(crypt_path_t *cpath, const char *key_data,

  if (!(cpath->f_crypto =
        crypto_create_init_cipher(key_data+(2*DIGEST_LEN),1))) {
    log_warn(LD_BUG,"Bug: forward cipher initialization failed.");
    log_warn(LD_BUG,"Forward cipher initialization failed.");
    return -1;
  }
  if (!(cpath->b_crypto =
        crypto_create_init_cipher(key_data+(2*DIGEST_LEN)+CIPHER_KEY_LEN,0))) {
    log_warn(LD_BUG,"Bug: backward cipher initialization failed.");
    log_warn(LD_BUG,"Backward cipher initialization failed.");
    return -1;
  }

@@ -1342,7 +1342,7 @@ choose_good_exit_server(uint8_t purpose, routerlist_t *dir,
               NULL, need_uptime, need_capacity, 0,
               options->_AllowInvalid & ALLOW_INVALID_RENDEZVOUS, 0, 0);
  }
  log_warn(LD_BUG,"Bug: unhandled purpose %d", purpose);
  log_warn(LD_BUG,"Unhandled purpose %d", purpose);
  tor_fragile_assert();
  return NULL;
}
Loading