From: Adam Dickmeiss Date: Thu, 1 May 1997 15:03:58 +0000 (+0000) Subject: Added ir-log command. X-Git-Tag: IRTCL.1.4~78 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=de8b921d9c8c3757f8c166582c76315c53122d37;p=ir-tcl-moved-to-github.git Added ir-log command. --- diff --git a/CHANGELOG b/CHANGELOG index b7e70a2..e9fe3ca 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -$Id: CHANGELOG,v 1.32 1997-04-30 07:26:05 adam Exp $ +$Id: CHANGELOG,v 1.33 1997-05-01 15:03:58 adam Exp $ 06/19/95 Release of ir-tcl-1.0b ------------------------------------------------------ @@ -119,3 +119,5 @@ $Id: CHANGELOG,v 1.32 1997-04-30 07:26:05 adam Exp $ 04/13/97 Added ir-log-init command. 04/30/97 Added shared library support. + +05/01/97 Added ir-log command. diff --git a/ir-tcl.c b/ir-tcl.c index 4650a77..efccf01 100644 --- a/ir-tcl.c +++ b/ir-tcl.c @@ -5,7 +5,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ir-tcl.c,v $ - * Revision 1.99 1997-04-30 07:24:47 adam + * Revision 1.100 1997-05-01 15:04:05 adam + * Added ir-log command. + * + * Revision 1.99 1997/04/30 07:24:47 adam * Spell fix of an error message. * * Revision 1.98 1997/04/13 18:57:20 adam @@ -3427,7 +3430,7 @@ static int ir_scan_obj_mk (ClientData clientData, Tcl_Interp *interp, /* ------------------------------------------------------- */ /* - * ir_log_proc: set yaz log level + * ir_log_init_proc: set yaz log level */ static int ir_log_init_proc (ClientData clientData, Tcl_Interp *interp, int argc, char **argv) @@ -3447,6 +3450,25 @@ static int ir_log_init_proc (ClientData clientData, Tcl_Interp *interp, return TCL_OK; } +/* + * ir_log_proc: log yaz message + */ +static int ir_log_proc (ClientData clientData, Tcl_Interp *interp, + int argc, char **argv) +{ + int mask; + if (argc != 3) + { + Tcl_AppendResult (interp, wrongArgs, *argv, + " level string\"", NULL); + return TCL_OK; + } + mask = log_mask_str_x (argv[1], 0); + logf (mask, "%s", argv[1], mask, argv[2]); + return TCL_OK; +} + + /* ------------------------------------------------------- */ static void ir_initResponse (void *obj, Z_InitResponse *initrs) { @@ -4109,6 +4131,8 @@ EXPORT (int,Irtcl_Init) (Tcl_Interp *interp) (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); Tcl_CreateCommand (interp, "ir-log-init", ir_log_init_proc, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); + Tcl_CreateCommand (interp, "ir-log", ir_log_proc, + (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); return TCL_OK; }