Topic: Computers It's the little things

(link)

4:19pm, Wednesday 8 November 2006

What's the point of providing debug output if it doesn't contain useful information? This afternoon I have done:

#define DH3HACK 1
#ifdef DH3HACK
  {
    struct sockaddr_in sin;
    socklen_t len = sizeof(sin);

    if (getpeername(fd, (struct sockaddr *) &sin, &len) == 0) {
      syslog(LOG_DEBUG, "accepted connection from %s", inet_ntoa(sin.sin_addr));
    } else {
      syslog(LOG_DEBUG, "accepted connection");
    }
  }
#else
  syslog(LOG_DEBUG, "accepted connection");
#endif
and similar, because Cyrus says "ooh yes, new connection" without bothering to tell you where the data is coming from...

back to main

<-
 Topic:    
->

Powered by Personal Weblog.

March 2024
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Feb   Apr

[RSS]

 


 


Dave Holland <dave@biff.org.uk>
$Id: index.php,v 1.75 2010-07-09 22:15:04 dave Exp $