Hello Patrick,

Before going into details, i.e. reviewing the patch I'd like to make sure I understand what is the goal:

- you want a single log file for ALL logging, which means:
- both global and session log of libsynthesis (including messages generated by the DB plugins)
  - PLUS messages generated by your application

Right?

I don't see why you need two engines for that. You can initialize the same engine twice, once at the beginning with basically only the log options, and a second time when your generated config stream is ready.

Within the engine, you need:

- a new flag to have the session logger redirect its output to the global logger, and also forwarding the <appendtoexisting> flag to the global logger such that it won't overwrite the beginning of the log. Maybe some changes are needed to prevent re-instantiation of the global logger at the second init, I'll have to check that.

- a way to send debug message from the outside (the app) into the global log. Luckily, these already exist (Beat uses them exactly this way in his test suite). See DB_DebugPuts, DB_DebugBlock, DB_DebugEndBlock and DB_DebugEndThread entries in the UI_Call_In record, or the ready-to-use wrappers for these in SDK_utils (DEBUG_xxx).

Just let me know if your goal is something entirely different I haven't understood so far.

But if I'm correct, I think we have do a much less invasive solution - and especially can avoid EVIL globals :-)

Best Regards,

Lukas Zeller


On Jun 30, 2009, at 20:04 , Patrick Ohly wrote:

Hello!

My goal since switching to the Synthesis engine was to have one single
log file again. There are other ideas for logging improvements, but the
single log is the most important one:
http://bugzilla.moblin.org/show_bug.cgi?id=3474

I've been dragging my feet a bit with it and I knew it would be kind of complicated, but now I have something which works. Beware, I didn't say
it is nice ;-}

It's also not final yet, but if possible, I'd like to get it done this
week. I've pushed the code into the moblin.org "logging" branch of
libsynthesis and SyncEvolution.

Lukas, Beat, can you have a look at the code and tell me whether this is okay in principle and what might have to be changed to make it suitable
for upstream?

The main issues I see are:
     * had to use a global variable to pass information
       (TSyncAppBase::fGlobalAppLoggerP); ideally I'd pass the handle
       for the first engine (with the active logger) to the creator of
       the second engine (the one with the datastores)
     * can only log plain text via DB_DebugPuts_Func(); I'd like to
       include more information (severity level, source file/line)

--
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.



_______________________________________________
os-libsynthesis mailing list
[email protected]
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Lukas Zeller ([email protected])
-
Synthesis AG, SyncML Solutions  & Sustainable Software Concepts
[email protected], http://www.synthesis.ch




_______________________________________________
os-libsynthesis mailing list
[email protected]
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Reply via email to