Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-03

Share a port through lazarus-ccr

13 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Thierry Coq
to Carlos German Tejero

I would be interested in the port of Log4delphi, too.

Best regards,
Thierry

Carlos German Tejero wrote 14 lines
Hi to all!! I want share a port off log4delphi (http://log4delphi.sourceforge.net/) through lazarus-ccr. how can I do? -- Carlos Germ?n Tejero ------------------------------------------------------------------------ _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Carlos German Tejero
to Thierry Coq

The port can be used with delphi or fpc.

2009/3/28 Thierry Coq

Show quoted text 26 lines
I would be interested in the port of Log4delphi, too. Best regards, Thierry Carlos German Tejero wrote: > Hi to all!! > I want share a port off log4delphi > (http://log4delphi.sourceforge.net/) through lazarus-ccr. > how can I do? > > -- > Carlos Germ?n Tejero > ------------------------------------------------------------------------ > > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus > _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Carlos Germ?n Tejero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090328/e45ecc5c/attachment.html

Reply by email

Carlos German Tejero
to Bogusław Brandys

i'm not know multilog. Maybe is better then log4delphi. log4delphi is a port of log4j for ObjectPascal programing language, has a very clean design, is very wel documented, and now can be used with delphi and fpc.
I tested this in windows (32 and 64 bits) and linux (32 bits).

2009/3/28 Bogus?aw Brandys

Show quoted text 13 lines
Carlos German Tejero wrote: > The port can be used with delphi or fpc. What is unique in log4delphi compared to multilog package ? Boguslaw _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Carlos Germ?n Tejero -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090328/4d19bf57/attachment.html

Reply by email

Graeme Geldenhuys
to Bogusław Brandys: What is unique in log4delphi compared to multilog package ? Boguslaw

Hi,

2009/3/28 Bogus?aw Brandys :

What is unique in log4delphi compared to multilog package ?

And how does both of these differ to the built-in logging support from tiOPF? I went to the log4delphi sourceforge website. It seems it's usage and features are very similar to tiOPF's logging support, but it still seems that tiOPF has more features and options.

eg: log4delphi
logger.debug('a debug log message')
logger.warn('a warning log message')

eg: tiOPF

   Log('a debug log message', lsDebug);
   Log('a warning log message', lsWarning);
  or simply...  Log('a log message');

tiOPF's logging is also thread safe, can save in the application folder or under Linux & Vista in the users writeable 'Application Data' directory. You also have a -l (log to file), -lc (log to console) or -lv (log to file and gui window) application parameter.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys
Graeme Geldenhuys wrote 8 lines
2009/3/28 Bogus?aw Brandys : > > What is unique in log4delphi compared to multilog package ? And how does both of these differ to the built-in logging support from tiOPF? ?I went to the log4delphi sourceforge website. It seems it's usage and features are very similar to tiOPF's logging support, but it still seems that tiOPF has more features and options.

Saying that, 'multilog' package seems very impressive, but the 3rd party component dependencies seem a bit high. Even so, I might steal some ideas from the core code and implement them in tiOPF's logging. :-)

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Bogusław Brandys
to Graeme Geldenhuys
Graeme Geldenhuys wrote 17 lines
On Mon, Mar 30, 2009 at 9:32 AM, Graeme Geldenhuys wrote: > 2009/3/28 Bogus?aw Brandys : >> What is unique in log4delphi compared to multilog package ? > And how does both of these differ to the built-in logging support from > tiOPF? I went to the log4delphi sourceforge website. It seems it's > usage and features are very similar to tiOPF's logging support, but it > still seems that tiOPF has more features and options. Saying that, 'multilog' package seems very impressive, but the 3rd party component dependencies seem a bit high. Even so, I might steal some ideas from the core code and implement them in tiOPF's logging. :-) Regards, - Graeme -

How about adding abstract class support from tiOPF to multilog ? That way multilog will drop a check on initialization of logging functons. Am I correct ? I always thought it was a nice tiOPF logging facility.

Regards
Boguslaw

Reply by email

Graeme Geldenhuys
to Bogusław Brandys

2009/3/30 Bogus?aw Brandys :

How about adding abstract class support from tiOPF to multilog ? That way multilog will drop a check on initialization of logging functons. Am I correct ?

I'm not sure I understand...

I always thought it was a nice tiOPF logging facility.

I just added a few new helper methods to tiOPF's tiLog unit - LogValue(...) for various simple types.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Luiz Americo Pereira Camara
to Graeme Geldenhuys: On Mon, Mar 30, 2009 at 9:32 AM, Graeme Geldenhuys Saying that, 'multilog' package seems…
Graeme Geldenhuys wrote 15 lines
On Mon, Mar 30, 2009 at 9:32 AM, Graeme Geldenhuys wrote: > 2009/3/28 Bogus?aw Brandys : > >> What is unique in log4delphi compared to multilog package ? >> > And how does both of these differ to the built-in logging support from > tiOPF? I went to the log4delphi sourceforge website. It seems it's > usage and features are very similar to tiOPF's logging support, but it > still seems that tiOPF has more features and options. > Saying that, 'multilog' package seems very impressive, but the 3rd party component dependencies seem a bit high.

The multilog package requires only a recent fpc. It's also possible to use under Delphi (The Delphi executable sends the messages to a file or to a viewer compiled with Lazarus). The "high 3rd party requirement" is for the complete viewer. A simple viewer requires only Lazarus.

It can send messages through one or more channels. Currently its implemented the file and IPC (SimpleIPC) channels. Implementing a new (Console) channel is trivial. See the file channel.

It also provides several helper methods to control with fine granularity what messages to send. Some of then can be seen at http://code.google.com/p/luipack/wiki/MultiLog, but must of them are not documented. In the demos some other possibilities are explored.

As example, it's possible to restrict to send only the messages that are called below a method/function call stack.
Also the ability to attach a message to more than one class, together with the DefaultClasses and ActiveClasses property provides many ways to filter the messages, depending only of the imagination of the programmer.

I used a lot to debug event messages (generally recursive) in LCL. Even in fpGui i used to debug the size behavior in Xlib/Win32 ;-).

Even so, I might steal some ideas from the core code and implement them in tiOPF's logging. :-)

Fell free to do it.

Luiz

Reply by email

Graeme Geldenhuys
to Luiz Americo Pereira Camara

On Mon, Mar 30, 2009 at 6:43 PM, Luiz Americo Pereira Camara

Show quoted text 5 lines
The multilog package requires only a recent fpc. It's also possible to use under Delphi (The Delphi executable sends the messages to a file or to a viewer compiled with Lazarus). The "high 3rd party requirement" is for the complete viewer. A simple viewer requires only Lazarus.

Ah, sorry I miss understood. Thanks for the info..

implemented the file and IPC (SimpleIPC) channels. Implementing a new (Console) channel is trivial. See the file channel.

I'll give that a try today... Anything to help debugging FPC applications, seeing that the FPC debugging is in a sad state at the moment.

It also provides several helper methods to control with fine granularity what messages to send. Some of then can be seen at

That's what we do in tiOPF as well. We have various 'log severities' defined. At compile time or runtime (via Visual Logger window) you can change log severities to see more or less information come through.

As example, it's possible to restrict to send only the messages that are called below a method/function call stack.

Can you explain this a bit more... Including the call stack. Currently my major obsticle in event programming is debugging the call stack. I often do the following as a quick fix...

procedure TMyform.SomeCall;
begin
  Log('>> TMyForm.SomeCall');
  { some code here}
  Log('<< TMyForm.SomeCall');
end;

I have improved on this slightly by using Interfaces. Create a interface variable that on creations writes the ">> ...' line and when the variable goes out of scope and gets destroyed, writes the '<< ...' line automatically.

eg:
procedure TMyform.SomeCall;
var
  logger: ILogger;
begin
  logger := gLog.GetLogger('TMyForm.SomeCall');
  { some code here}
end;

But as you can see, it's not much of an improvement, because I now need a local variable. :-(

A constant view of the callstack (say the last 20 calls) would be pretty awesome. Anybody know if this is possible with GDB or MultiLog etc?

> ?Even so, I might steal > some ideas from the core code and implement them in tiOPF's logging. Fell free to do it.

Already did. ;-)

I'll take a closer project seems quite interresting.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Luiz Americo Pereira Camara
to Graeme Geldenhuys
Graeme Geldenhuys wrote 10 lines
On Mon, Mar 30, 2009 at 6:43 PM, Luiz Americo Pereira Camara > It also provides several helper methods to control with fine granularity > what messages to send. Some of then can be seen at > That's what we do in tiOPF as well. We have various 'log severities' defined. At compile time or runtime (via Visual Logger window) you can change log severities to see more or less information come through.

In Multilog, additionally to the log severity that's another variable: the classes. The class is user defined up to 32 (in fact each class is defined by a byte value). Each message is attached to one or more classes. You can control what will send by ActiveClasses and DefaultClasses.

Say you have two messages.

Logger.Send('XXX');
Logger.Send([1], 'YYY');

If you set ActiveClasses to [1,2] and DefaultClasses to [0] only 'YYY' is sent
If you set ActiveClasses to [1,2] and DefaultClasses to [1] 'XXX' and 'YYY' is sent
If you set ActiveClasses to [0,2] and DefaultClasses to [0] only 'XXX' is sent

This is useful in events where you want to avoid messages triggered by system events.
As an example, you want to know what happens to in paint routines when you do some action in a control.
Set the log messages with a 'paint' class inside that routines. Around the action routine do

ActiveClasses := [paint]
do some action
ActiveClasses := []

You can also play with the DefaultClasses.
This will prevent to log when the paint routine is called by the system (focus change etc)

I have planned to add another layer to filter that will allow to filter by thread, by type of message and also buffer in memory before sending to the channel.

Show quoted text 9 lines
> As example, it's possible to restrict to send only the messages that are > called below a method/function call stack. > Can you explain this a bit more... Including the call stack. Currently my major obsticle in event programming is debugging the call stack. I often do the following as a quick fix...

When EnterMethod/ExitMethod is used, multilog keeps a track of the callstack. You can use CalledBy method to know if you are inside that stack. Also the text file and the messages tree are built using that info, so you can see the stack structure.

Also there's SendCallStack method that shows the fpc provided callstack. MaxStackCount controls the size of the stack

There's room to improvements: automatically detect if you are inside a method in the stack without the need to call Enter/ExitMethod, hook Lazarus IDE/GDB to automatically insert the log calls without need to change the source file.

Show quoted text 29 lines
procedure TMyform.SomeCall; begin Log('>> TMyForm.SomeCall'); { some code here} Log('<< TMyForm.SomeCall'); end; I have improved on this slightly by using Interfaces. Create a interface variable that on creations writes the ">> ...' line and when the variable goes out of scope and gets destroyed, writes the '<< ...' line automatically. eg: procedure TMyform.SomeCall; var logger: ILogger; begin logger := gLog.GetLogger('TMyForm.SomeCall'); { some code here} end; But as you can see, it's not much of an improvement, because I now need a local variable. :-( A constant view of the callstack (say the last 20 calls) would be pretty awesome. Anybody know if this is possible with GDB or MultiLog etc?

See above.

Luiz

Reply by email