portrait

Поиск



[software] [catdoc] [tcl] [geography] [old things]

TclSyslog

I was highly surprised that TclX package, which provides a lot of Unix-specific functionality for Tcl doesn't provide interface to syslog.

So, I've designed my own package.

I've not touched this package since 2000. It just works.

Documentation

  package require syslog
  syslog ?options? priority mesage  
Syslog command logs message to system syslog facility. By default, it uses syslog facility user and content of Tcl variable argv0 as identifier. It can be overriden by options of syslog command. Options available
-facility value
sets syslog facility to use. All values, defined in BSDI man page syslog(3) are defined. On Solaris facility authpriv is same as auth.
-ident string
sets id string to use.
-options value
set options to use in openlog(3) call. Options can be specified as numeric constant or (2.1 only) as list of symbolic names.
If any of these options is used, syslog command closes and reopens log. But openlog call is issued only on first call to syslog, so no overhead is expected, when you are specifying desired facility and ident upon first call to syslog.

It is also possible to call syslog just with options, without priority and message. Facilities and priorities are spelled in lowercase letter same (hopefully) way as in /etc/syslog.conf or logger(1) command line.

There are two version of this extension maintained - 1.x and 2.x. 1.x is for old Tcl, which is not Unicode inside. They don't use stubs interface and use string-based commmands.

2.x is Unicode-aware. It means that it is objectified, and it converts messages and ident strings from Unicode to current system encoding before sending them to library functions.

Download

Version 1.1 For tcl 7.x and 8.0.x
Version 2.1 For tcl 8.1 and above - stubs-enabled and Unicode aware. Version 2.0 For tcl 8.1 and above - stubs-enabled and Unicode aware.

GIT access

TclSyslog can also be obtained from my GIT repository via http protocol.
git clone http://www.wagner.pp.ru/git/oss/tclsyslog.git
See also GitWeb page

Bug tracking system

Access to bug tracking system allowed only via https. See my cvstrac page for instructions and certificate.