On 7/16/2010 4:22 AM, Germán Arduino wrote:
Not, I'm talking about a particular context. I needed a simple logging
of text on a text file and don't wanted to invest the time to
understand the whole thing behind the logger of K.

Germán.

I hear you, I like simple as well; I setup a syslog/syslog-ng server and let Linux worry about it. Here's my logger...

SysLog>>sendPriority: anErrorLevel body: someText
[ self sendPriority: anErrorLevel body: someText toServer: (SSConfig at: #sysLogServer) ]
                on: Error do: []

SysLog>>sendPriority: aPriority body: aBody toServer: anIPAddress
        | logServer client logHostIP |
        anIPAddress isEmptyOrNil ifTrue: [ ^self ].
        logServer := Socket newUDP setPort: 514.
        
        [ client := Socket newUDP.
[ logHostIP := ((anIPAddress split: '.') collect: [:e | e asInteger ]) asByteArray . client sendUDPData: aPriority , ' ' , aBody toHost: logHostIP port: logServer port ]
                ensure: [ client closeAndDestroy ] ]
        ensure: [ logServer closeAndDestroy ]

That's about all I need from my logging package.

--
Ramon Leon
http://onsmalltalk.com

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to