[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #1368 [Tor Client]: Implement a heartbeat log message



#1368: Implement a heartbeat log message
--------------------------------+-------------------------------------------
 Reporter:  Sebastian           |         Type:  enhancement
   Status:  needs_review        |     Priority:  major      
Milestone:  Tor: 0.2.3.x-final  |    Component:  Tor Client 
  Version:  0.2.1.25            |   Resolution:  None       
 Keywords:                      |       Parent:             
--------------------------------+-------------------------------------------

Comment(by nickm):

 Minor style issues:
   * In the documentation for the new functions in status.c, you don't
 explain what most of the functions actually return.  Instead of "count
 circuits", say "return the number of circuits"; instead of "Transform X
 into Y", say "Return a new string Y containing..." and so on

   * Let's never display the exact number of bytes; let's always round to
 the nearest 1k.
   * Our code style is K&$; we never do
 {{{
    if (a) {
       b
    } /* The "else" should be on this line */
    else {
        c;
    }
 }}}

   * Don't cast to "long long unsigned int" before printf on a uint64_t,
 and don't assume that "%llu" will work for the format.   Use the
 U64_PRINTF_ARG and U64_FORMAT definitions in src/common/compat.h instead.
   * "If I were you, I'd check this out, something there is something fishy
 going on!" is not helpful to users; they will just get confused and send
 us email or file bug reports.  If the log message is going to suggest
 action, it should suggest a concrete course of action that users can
 follow.
   * Functions that return things are usually called "get_X()", not
 "export_X".  Also, there is no need to document that a function is
 "exported"; we assume that the reader knows C and knows what a lack of
 "static" means.
   * Be sure to run "make check-spaces"
   * The manpage should say "Tor server", not "Tor instance", since clients
 don't have a heartbeat.

 Design issues:

   * What is the point of logging the time as a long anyway?  This is meant
 to be a human-readable thing, and humans can just look at the time of the
 log message, right?
   * What else do we envision moving to "status.c" / "status.h" ?

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/1368#comment:16>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs