Hi all! Sorry for making you wait, here is the promised post about logger.
http://concretetypeinference.blogspot.com.ar/2012/06/pharo-logger-aka-paul-octopus-or-le.html?showComment=1338652375489#c726596285523609676
Sorry for the awful text-format, blogger is really ugly. I'll be opening a wordpress blog and migrating all the posts the sooner as i can.
Try to use it if you need a logger and please, send feedback!
The needed code to addit to any project is really few, for an easy example, download the project and see at examples :).
Santiago.
Ok
I' think i just need to add test and then is already usable. ( If you think i must add anything, just say it :)� )
About last changes and configuration:
The last add is pragma support: We have 2 pragmas configuration:
<logConfiguration> That indicates the class method� related know how to manage de log configuration
There is support to usit this way:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
configurationOfLog
��� <logConfiguration>
��� ^ [��� ��� ��� ���� showingLogAs: ('%pih | %tstmp | %tag #%class >> %selector [%log]' asPatternFormatter)
��� ���� :builder |
� ���� builder forClass:LogTestObject
��� ��� ��� ���� useLevel:#info
��� ��� ��� ���� into: Transcript asLogWriter
��� ��� ��� ���� holdLogInstances:true.
��� ].
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
and this way
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
configurationOfLog: builder
��� <logConfiguration>��� ��� ��� ���� showingLogAs: ('%pih | %tstmp | %tag #%class >> %selector [%log]' asPatternFormatter)
������ builder forClass:LogTestObject
��� ��� ��� ���� useLevel:#info
��� ��� ��� ���� into: Transcript asLogWriter
��� ��� ��� ���� holdLogInstances:true.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The other pragma is
<logConfigurationAs:#aSymbol >
This pragma says 'hey, forme use the #aSymbol configuration!', such as #default.
then you can go to
LogConfiguration >> configuration class method
and add symbols with named configurations and relate with explicit classes with a simple pragma :)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
For other side, the manage of the 'if-the-class-has-not-configuration' is the same, search for the package configuration (that should be added in LogConfiguration >> configuration class method ), and if is not a package configuration, then go for the #default configuration.
Tomorrow ill be adding tests and making a post on my blog with all the functionalities:
Writers available (Memory, File, Stdout, Transcript, CompositeWriter)
Formatters available (Pattern based -the one of the sample- SimpleFormatter and CustomFormatter)
Filters available (the one who says how to decides if the log must be showed or just skiped -- CategoryFilter and LevelFilter. )
Holder ( an object which stores LogEntity objects - an object very much richier than the string stored for MemoryWriter)
And ill add to the post how to write nice configurations with the existing code and, of course, how to add functionality in the way i thought the framework.
Again, the idea of this framework is to be used for all and have just one logger, so, please, if any one think i must add or change something, share it here. And if any wants to get his hands on the code the same, just say it.�