Kristian Lyngst?l wrote:> On 5/24/07, Mike Dransfield <mike at blueroot.co.uk> wrote:
>> Attached is a quick patch which adds a logging framework to compiz.
>> I think it should be fairly self explanitory.
>>
>> I think it should allow plugin writers to extend it for any purpose,
but
>> I would appreciate any feedback or comments before going any further.
>
> Looks good, we did something similar with Beryl which at least I
> believe helped.
>
> How about moving the proc to CompScreen? That way, I can wrap the
> function in a hypothetical debug plug-in to print information about
> the screen the log message occurred on (I have two).
It sounds like a good idea to have a debug plugin as well
as some more information in the messages from core.
I did not want the logging mechanism to know anything
about the message being logged, for this reason I have modified
the patches so that the wrapped function just takes a string
rather than a format/args combination.
I think that debugging can be acheived just by agreeing on a
debug log format. This way any debug logs will all be in the same
format and could be parsed at a later date with another app.
If we added a compiz event to the screenshot plugin then a debug
plugin could also do other things like recording the screenshot time
and date with the log. The debug plugin could wrap logMessage
and store the message in a different location and even upload it
later with the screenshots.
I have a small demo plugin which uses libnotify to show errors
to the user, it should be useful for plugin errors etc.
http://www.anykeysoftware.co.uk/compiz/plugins/notify.c
>
> While plug-ins can obviously create their own macros, I also believe
> it makes a lot of sense to have a few macros for this in compiz.h,
> specially for core.
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: logging.diff
Url:
http://lists.freedesktop.org/archives/compiz/attachments/20070525/38403f89/attachment.txt