Toothpick - a simple configurable Logging mechanism for Smalltalk
is now also available as Monticello package on SqueakSource and SqueakMap. I just converted the source zip into a monticello package with kindly permission from Joseph Pelrine. His code is released under BSD license. More infos can be found on: http://www.metaprog.com/Toothpick/index.html http://minnow.cc.gatech.edu/squeak/5890 (includes an example script) The Monticello repository on http://www.squeaksource.com/Toothpick has read/write access for future contributions. Since Toothpick is available for various Smalltalk dialects contributions should not be limited to Squeak. Keep on talking small Bye Torsten -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer |
Hi all!
"Torsten Bergmann" <[hidden email]> wrote: > Toothpick - a simple configurable Logging mechanism for Smalltalk > is now also available as Monticello package on SqueakSource > and SqueakMap. I just converted the source zip into a monticello > package with kindly permission from Joseph Pelrine. His code is > released under BSD license. Great! I also saw this (from the Bern day) and intend to take a look but just wanted to mention: Gjallar has a small logging solution inside that would be interesting to compare/merge with this. It is small (4 classes IIRC) and has a Morphic tool as one of the backends. The next step would have been adding syslogd UDP to it - but I think Toothpick has this so it would be more interesting in merging I guess. If anyone wants to tackle this contact me or the setools list - the logging parts in Gjallar should be totally separate, but is not packaged separate right now (Q2Log, Q2LogFile, Q2LogMorph). It is not obvious that a merge is best - Q2Log (and friends) is very small and Squeak specific - both of which can be advantages compared to Toothpick. But Toothpick is obviously more capable. I include the class comment of Q2Log below. regards, Göran PS. There is also at least one more logger on SM. Btw, ripping out UDP code from Toothpick and adding that to Q2Log in the next 7 days would be a strong candidate for the Ipod competition.... :) Or any other interesting combo - like rewriting Q2Log as a facade to Toothpick, or whatever. --------------------------------------- Nice and simple logging. There are eight messages for logging based on severity. These correspond to the eight levels defined in syslog: 7 - debug (Debug-level messages) 6 - info (Informational) 5 - notice (Normal but significant Condition) 4 - warning (Warning Condition) 3 - err (Error Condition) 2 - crit (Critical Conditions) 1 - alert (must be handled immediately) 0 - emerg (System is unusable) The absolutely easiest way to log is like this: Q2Log warn: 'Oopsidaisy' We only need to include the actual message in the string, timestamp etc is added automatically. You can also explicitly supply a "sender" object which can be anything you like, a symbol or a specific domain object even: Q2Log warn: 'Yowsa' sender: #email Q2Log uses printString on the sender when producing the log entry, so if you use domain objects - make sure they have a unique printOn: method defined so that you can distinguish them. See class side category "logging" and "logging shorthand" for the available log messages. By default there is a single emitter registered that logs on Transcript, you can turn this off with: Q2Log useTranscript: false And you can set a threshold for the above 8 syslog levels that should be logged onto Transcript using: Q2Log instance transcriptMaxLevel: 4 ..or set a global threshold for all emitters: Q2Log instance globalMaxLevel: 4 Global flushing of all emitters can be done using "Q2Log flush" and should ideally be called regularly by some background process. Finally take a look at Q2LogFile for details on how to add it as an emitter to get logging onto file instead of Transcript, and Q2LogMorph for getting logging into a very nice UI that offers filtering, searching etc. |
In reply to this post by Torsten Bergmann
Great!
Add Toothpick to 3.9 dev image please (Damien Cassou). pf Torsten Bergmann píše v Čt 02. 11. 2006 v 20:22 +0100: > Toothpick - a simple configurable Logging mechanism for Smalltalk > is now also available as Monticello package on SqueakSource > and SqueakMap. I just converted the source zip into a monticello > package with kindly permission from Joseph Pelrine. His code is > released under BSD license. > > More infos can be found on: > > http://www.metaprog.com/Toothpick/index.html > http://minnow.cc.gatech.edu/squeak/5890 (includes an example script) > > The Monticello repository on http://www.squeaksource.com/Toothpick > has read/write access for future contributions. Since Toothpick > is available for various Smalltalk dialects contributions should > not be limited to Squeak. > > Keep on talking small > Bye > Torsten > > > |
In reply to this post by Göran Krampe
2006/11/3, [hidden email] <[hidden email]>:
> Hi all! > > "Torsten Bergmann" <[hidden email]> wrote: > > Toothpick - a simple configurable Logging mechanism for Smalltalk > > is now also available as Monticello package on SqueakSource > > and SqueakMap. I just converted the source zip into a monticello > > package with kindly permission from Joseph Pelrine. His code is > > released under BSD license. > > Great! > > I also saw this (from the Bern day) and intend to take a look but just > wanted to mention: > > Gjallar has a small logging solution inside that would be interesting to > compare/merge with this. It is small (4 classes IIRC) and has a Morphic > tool as one of the backends. The next step would have been adding > syslogd UDP to it - but I think Toothpick has this so it would be more > interesting in merging I guess. > > If anyone wants to tackle this contact me or the setools list - the > logging parts in Gjallar should be totally separate, but is not packaged > separate right now (Q2Log, Q2LogFile, Q2LogMorph). > > It is not obvious that a merge is best - Q2Log (and friends) is very > small and Squeak specific - both of which can be advantages compared to > Toothpick. But Toothpick is obviously more capable. > > I include the class comment of Q2Log below. > > regards, Göran > > PS. There is also at least one more logger on SM. Btw, ripping out UDP > code from Toothpick and adding that to Q2Log in the next 7 days would be > a strong candidate for the Ipod competition.... :) Or any other > interesting combo - like rewriting Q2Log as a facade to Toothpick, or > whatever. > > --------------------------------------- > Nice and simple logging. There are eight messages for logging based on > severity. These correspond to the eight levels defined in syslog: > > 7 - debug (Debug-level messages) > 6 - info (Informational) > 5 - notice (Normal but significant Condition) > 4 - warning (Warning Condition) > 3 - err (Error Condition) > 2 - crit (Critical Conditions) > 1 - alert (must be handled immediately) > 0 - emerg (System is unusable) > > The absolutely easiest way to log is like this: > > Q2Log warn: 'Oopsidaisy' > > We only need to include the actual message in the string, timestamp etc > is added automatically. > You can also explicitly supply a "sender" object which can be anything > you like, a symbol or a specific domain object even: > > Q2Log warn: 'Yowsa' sender: #email > > Q2Log uses printString on the sender when producing the log entry, so if > you use domain objects - make sure they have a unique printOn: method > defined so that you can distinguish them. See class side category > "logging" and "logging shorthand" for the available log messages. > > By default there is a single emitter registered that logs on Transcript, > you can turn this off with: > > Q2Log useTranscript: false > > And you can set a threshold for the above 8 syslog levels that should be > logged onto Transcript using: > > Q2Log instance transcriptMaxLevel: 4 > > ..or set a global threshold for all emitters: > > Q2Log instance globalMaxLevel: 4 > > Global flushing of all emitters can be done using "Q2Log flush" and > should ideally be called regularly by some background process. > > Finally take a look at Q2LogFile for details on how to add it as an > emitter to get logging onto file instead of Transcript, and Q2LogMorph > for getting logging into a very nice UI that offers filtering, searching > etc. logging to syslog (via UDP). SyslogToothpick provides a Toothpick adapter. SyslogFFI uses the syslog system call via FFI (likely only works on my machine). SyslogFFIToothpick provides a Toothpick adapter for it. They are not really tested and likely contain bugs. I have some general questions about Toothpick: - The FileLogger seems to overwrite the file for every logging event. Is that correct or do I miss something? - every Toothpick object that defines #initialize receives it twice. Is that intended? - The class documentation of LoggingEvent seems to be wrong. level is an integer, not a symbol. - Where is the part of XMLLoggingFormatter that does escaping? What's the root node and where does it get written? [1] http://www.squeaksource.com/syslog/ Cheers Philippe |
Hi!
First a question - your post is in base64 encoding which my Celeste has real trouble with. At least it gets formatted like crap when viewing it and reply does not work at all. Perhaps I should try a new Celeste. Is this some kind of standard setting in your email client? Secondly, you wrote: > There is a small package called syslog on SqueakSource [1] that does logging to syslog (via UDP). SyslogToothpick provides a Toothpick adapter. SyslogFFI uses the syslog system call via FFI (likely only works on my machine). SyslogFFIToothpick provides a Toothpick adapter for it. They are not really tested and likely contain bugs. Cool! I should take a look at that. regards, Göran PS. Added simple log rotation to Q2LogFile yesterday. :) Unless someone else does it I should repackage Q2Log as a separate logging package, it is small, neat and quite useful IMHO. Gotta sit down and compare it with Toothpick though. |
2006/11/14, [hidden email] <[hidden email]>:
> Hi! > > First a question - your post is in base64 encoding which my Celeste has > real trouble with. At least it gets formatted like crap when viewing it > and reply does not work at all. Perhaps I should try a new Celeste. Is > this some kind of standard setting in your email client? Hmm, GMail configured to use UTF-8. If you have any pointers, I'd be happy to hear them. Philippe > Secondly, you wrote: > > > > There is a small package called syslog on SqueakSource [1] that does > logging to syslog (via UDP). > SyslogToothpick provides a Toothpick adapter. > SyslogFFI uses the syslog system call via FFI (likely only works on my machine). > SyslogFFIToothpick provides a Toothpick adapter for it. > > They are not really tested and likely contain bugs. > > Cool! I should take a look at that. > > regards, Göran > > PS. Added simple log rotation to Q2LogFile yesterday. :) Unless someone > else does it I should repackage Q2Log as a separate logging package, it > is small, neat and quite useful IMHO. Gotta sit down and compare it with > Toothpick though. > > |
Free forum by Nabble | Edit this page |