[tor-bugs] #7325 [pyobfsproxy]: Scrub IPs before displaying them in logs

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Nov 12 14:07:30 UTC 2012


#7325: Scrub IPs before displaying them in logs
-------------------------+--------------------------------------------------
 Reporter:  sysrqb       |          Owner:  asn           
     Type:  defect       |         Status:  needs_revision
 Priority:  normal       |      Milestone:                
Component:  pyobfsproxy  |        Version:                
 Keywords:               |         Parent:                
   Points:               |   Actualpoints:                
-------------------------+--------------------------------------------------
Changes (by asn):

  * status:  needs_review => needs_revision


Comment:

 Thanks for the code and the review!

 Some more comments/nitpicking:

 * What is the relationship between `ObfsLogger` and `our_logger`? Both
 names sound the same. Could they be the same thing? Maybe we should
 incorporate `our_logger` into `ObfsLogger` and have `ObfsLogger` be
 responsible for the logging subsystem, as its name implies?

 * I'm not really a fan of the `log.obfslogger =
 log.get_obfslogger(args.no_safe_logging)` in `obfsproxy.py`. I don't like
 code of `obfsproxy.py` patching stuff of the logging subsystem.

 Maybe `ObfsLogger` could be instantiated in start-time (like `our_logger`
 does atm), and have a `set_safe_logging()` method that can be called from
 `obfsproxy.py` when args are parsed? This is related to the previous
 comment.


 * Is `we_should_scrub_address()` useless now? Maybe we should remove it?

 * You seem to be coding in 2-spaces-per-indentation-level, but the rest of
 pyobfsproxy is in 4-spaces-per-indentation-level. I don't have anything
 against 2-spaces, but let's keep the codebase uniform.

 * I wonder if `self.safe_logging = not no_safe_logging` would look better
 than the current `ObfsLogger:__init__()`.

 ----

 If you don't have time to think of these comments, just tell me and I will
 look into it.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/7325#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list