phatch-dev team mailing list archive
-
phatch-dev team
-
Mailing list archive
-
Message #00759
Re: Phatch log format
Nadia, good point. Please make a blueprint for the logging. Feel free
to take the design of the new logging as far as you want. Logging
should serve indeed two audiences: users and developers. If this would
require to offer a simplified view of the developer log to the user,
that is fine for me, but in that case both have to be implemented. I
am also not opposed using the standard logging module as than we could
set the level by a command line option or a user preference. Note
that now logging happens by the photo.info object.
Best regards,
Stani
On Fri, Oct 9, 2009 at 12:05 PM, Nadia Alramli <nadiana@xxxxxxxxx> wrote:
> Hey Robin,
>
> Nice to hear from you :)
> Please reply to the group mailing address so everyone can read your
> suggestions ;)
>
>>
>> I strongly encourage you to write the log file an existing language -
>> Python being the obvious candidate (or XML or JavaScript/JASON). In this
>> way every message is an object and additional fields can be added without
>> impacting your parser. As you know, I don't really know Python, however in
>> JavaScript an error message could be written as:
>> { 'type' : 123
>> , 'Target' : 'something'
>> , 'Action' : 'GeoTag.py'
>> , 'Date' : new Date('Thu Oct 08 2009 15:26:00 GMT-0700 (PDT)')
>> , etc etc ........
>> } //
>
> That will actually be very good from the parsing prospective, but not for
> users readability. Since the logs are displayed to users at the end of
> actionlist execution. So they should also be user friendly. Unless we are
> going to show the users a different version of the error message.
>
>>
>> If you later want to know the user's name, machine type and so on, you can
>> add those fields easily. Looping over a directory of error messages is a
>> two minute job.
>> Is there anything like this already in Python for reporting bugs to the
>> Python people?
>
> There is a very good logging module in the python library. It doesn't use
> XML or JSON, just plain text. But it is very handy if you want to follow the
> same template for errors.
>
> Best Regards,
>
> Nadia
>
>> On Oct 8, 2009, at 14:40 PM, Nadia Alramli wrote:
>>
>> Hey,
>> I've been trying to figure a good way to parse phatch logs in the test
>> suite. However, the current log format is not parsing friendly. I really
>> would prefer to spend the effort on improving the log format rather than
>> hacking a solution around the current one.
>> It would really help if all logs followed the same template and indicated
>> the type of the log at the beginning. It will also be more user friendly if
>> the errors numbers started from 1 rather than 0. Here is a suggestion:
>> %(type) %(number): %(message)
>> <tab>Target: %(target)
>> <tab>Action: %(action)
>> <tab>Details: %(details)
>> <newline>
>> %(type) %(number): %(message)
>> <tab>Target: %(target)
>> <tab>Action: %(action)
>> <tab>Details: %(details)
>> The type can be warning or error
>> If the error was an exception that can't be linked to a specific action or
>> image then the format can become:
>> %(type) %(number): %(message)
>> <tab>Message: %(message)
>> <tab>Details: %(details)
>> That will make parsing possible. It is also more consistent and easier to
>> understand for end users as well.
>> Best Regards,
>> Nadia
>> _______________________________________________
>> Mailing list: https://launchpad.net/~phatch-dev
>> Post to : phatch-dev@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~phatch-dev
>> More help : https://help.launchpad.net/ListHelp
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~phatch-dev
> Post to : phatch-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~phatch-dev
> More help : https://help.launchpad.net/ListHelp
>
>
--
Phatch Photo Batch Processor - http://photobatch.stani.be
SPE Python IDE - http://pythonide.stani.be
References