Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74071

Re: How do you use `help` when write your code

References (1 earlier) <f2559e87-6100-4e1d-9cc6-90aebe6133d1@googlegroups.com> <mailman.11552.1404673207.18130.python-list@python.org> <roy-CE5D08.15151006072014@news.panix.com> <mailman.11564.1404687291.18130.python-list@python.org> <roy-4B7140.20523306072014@news.panix.com>
Date 2014-07-07 13:06 +1000
Subject Re: How do you use `help` when write your code
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.11570.1404702375.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, Jul 7, 2014 at 10:52 AM, Roy Smith <roy@panix.com> wrote:
> In article <mailman.11564.1404687291.18130.python-list@python.org>,
>  Chris Angelico <rosuav@gmail.com> wrote:
>
>> But the important thing is that you log.
>
> I 'spose.  Let's see.  Yesterday we generated 133 GB of log files.  And
> Sunday is a slow day :-)

Heh, that's a bit bigger in scale than most of what I work with... but
yes. I have a log file of the from and to addresses of every email
that goes through my spam filter, and whether it was marked spam or
ham; the expectation is that any mail that doesn't bounce (the server
will reject prior to this log based on certain rules) will be in the
log, so if anyone asks about something, I can grep the log for an
address. It's a fairly compact log, and this is a fairly small site,
so the growth is a lot slower than 133GB/day! But the principle's the
same: log today so you can find a problem tomorrow.

>> Have you ever had a bug where someone else finds it and then doesn't
>> give you full repro steps?
>
> Are there people like that where you are?  Weird.

Yes, sadly, there are people just about everywhere.

(Despite my post being in response to one of yours, Roy, I still
partly felt that I was addressing Rick. Hence the slightly odd wording
of something that, for most of us, is a "duh" matter.)

>> There are times when you have to go for the "Real Programmer"
>> debugging style. Pretend the program is a black box, no source code
>> available, nothing.
>
> Yup; strace and tcpdump are two of my best friends.  The source code
> only tells you what the program is *supposed* to do.  Strace tells you
> what it did.  And tcpdump tells you what it said.

That's about it, yeah. I tend to find both strace and tcpdump rather
too spammy for most usage, so any time I reach for those tools, it's
usually with some tight filtering - and even that's not always
helpful. The last thing I straced was a (closed-source) game that was
having some problems (cross-platform, I'm one of a very small number
of Linux testers), and it was running at well over 100 FPS... and each
frame involved quite a few system calls. Yeah, that was spammy.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How do you use `help` when write your code Shiyao Ma <i@introo.me> - 2014-07-07 00:36 +0800
  Re: How do you use `help` when write your code Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-06 17:52 +0000
    Re: How do you use `help` when write your code Tim Chase <python.list@tim.thechases.com> - 2014-07-06 13:22 -0500
    Re: How do you use `help` when write your code Roy Smith <roy@panix.com> - 2014-07-06 14:48 -0400
  Re: How do you use `help` when write your code Rick Johnson <rantingrickjohnson@gmail.com> - 2014-07-06 11:48 -0700
    Re: How do you use `help` when write your code Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-06 19:58 +0100
      Re: How do you use `help` when write your code Roy Smith <roy@panix.com> - 2014-07-06 15:15 -0400
        Re: How do you use `help` when write your code Chris Angelico <rosuav@gmail.com> - 2014-07-07 08:54 +1000
          Re: How do you use `help` when write your code Roy Smith <roy@panix.com> - 2014-07-06 20:52 -0400
            Re: How do you use `help` when write your code Chris Angelico <rosuav@gmail.com> - 2014-07-07 13:06 +1000
              Re: How do you use `help` when write your code Roy Smith <roy@panix.com> - 2014-07-07 07:22 -0400
                Re: How do you use `help` when write your code Chris Angelico <rosuav@gmail.com> - 2014-07-07 21:36 +1000
        Re: How do you use `help` when write your code Cameron Simpson <cs@zip.com.au> - 2014-07-07 11:51 +1000

csiph-web