Re: [PATCH] Show call depth with spaces in log_method_call()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/15/2010 04:24 AM, Ales Kozumplik wrote:
>> +    fmt = "%s%s.%s:"
>>       fmt_args = [classname, methodname]
>> +
>> +    spaces = len(stack) * ' '
>> +    fmt_args.insert(0, spaces)
> 
> Why not:
> spaces = len(stack) * ' '
> fmt = "%s%s.%s:"
> fmt_args = [spaces, classname, methodname]

Sure, I can do it that way if you think it's more readable.

> Otherwise it is a nice thing, hopefully the call stack doesn't get so
> deep that the lines break on a normal terminal.

They don't seem to get all that bad in general, especially in our new
KMS world of tiny fonts.  I have another patch to void this problem, but
it's a bit of a hack - basically, I make log_method_call() remember the
depth of the shortest stack it's ever seen, and subtract that number from
len(stack).  Then I added a call to log_method_call() call at the beginning
of DeviceTree.__init__(), since that appears to be in every call path that
ever calls it, or at least the vast majority of them.

As I said, a bit of a hack.

-- 
        Peter

When in doubt, debug-on-entry the function you least suspect has
anything to do with something.

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux