-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

implements one of the TODOs in the fifo.cpp ;^): 

adds to fifo commands a "debuglvl" command to complement the `redirect' 
command. now you can do:
  echo 'redirect /tmp/licq.log'>~/.licq/licq_fifo
  echo 'debuglvl 31' >/.licq/licq_fifo 

 -juan.
-----BEGIN PGP SIGNATURE-----

iD8DBQE9NyGbUMlRieHkprgRArzKAJoDuc/xBQitKOhVBxgl6M7PivJLQACfSwR6
Acy+Xm8URKyDb+hypDHbEgc=
=RR0y
-----END PGP SIGNATURE-----
Index: doc/README.FIFO
===================================================================
RCS file: /cvsroot/licq/licq/doc/README.FIFO,v
retrieving revision 1.1
diff -u -d -p -r1.1 README.FIFO
--- doc/README.FIFO	17 Jul 2002 03:36:08 -0000	1.1
+++ doc/README.FIFO	18 Jul 2002 20:07:36 -0000
@@ -46,6 +46,10 @@ FIFO COMMANDS
 	redirect <file>
 		Redirects the stdout and stderr for licq to the given file
 
+	debuglvl <level>
+		set what information is logged
+		see <level> in licq -h
+
 	adduser <buddy>
 		Add a user to your contact list. note that buddy must be an uin
 
Index: src/fifo.cpp
===================================================================
RCS file: /cvsroot/licq/licq/src/fifo.cpp,v
retrieving revision 1.1
diff -u -d -p -r1.1 fifo.cpp
--- src/fifo.cpp	17 Jul 2002 03:36:08 -0000	1.1
+++ src/fifo.cpp	18 Jul 2002 20:07:37 -0000
@@ -2,8 +2,7 @@
  * FIFO commands
  *
  * TODO things
- *	o file transfers, change debug level (we can redirect but not change
- *	| the debug level
+ *	o file transfers
  * THOUGTHS 
  *	o a flag so message, url, etc can been forced to fail if buddy is not
  *	| in the list ?
@@ -72,6 +71,10 @@ static const char* const HELP_REDIRECT =
 	"\tredirect <file>\n"
 	"\t\tRedirects the stdout and stderr for\n"
 	"\t\tlicq to the given file\n";
+static const char* const HELP_DEBUGLVL = 
+	"\tdebuglvl <level>\n"
+	"\t\tset what information is logged\n"
+	"\t\tsee <level> in licq -h\n";
 static const char* const HELP_ADDUSER = 
 	"\tadduser <buddy>\n"
 	"\t\t add a user to your contact list. note\n"
@@ -304,6 +307,20 @@ fifo_redirect ( int argc, const char *co
 	return 0;
 }
 
+// debuglvl <level>
+static int
+fifo_debuglvl ( int argc, const char *const *argv, void *data)
+{	
+	int nRet = 0; 
+
+	if( (nRet = (argc == 1)) )
+		ReportMissingParams(argv[0]);
+	else
+		gLog.ModifyService( S_STDOUT, atoi(argv[1]));
+
+	return -nRet;
+}
+
 // adduser <buddy>
 static int
 fifo_adduser ( int argc, const char *const *argv, void *data)
@@ -438,6 +455,7 @@ static struct command_t fifocmd_table[]=
 	{"message",	fifo_message,	HELP_MSG,	0},
 	{"url",		fifo_url,	HELP_URL,	0},
 	{"redirect",	fifo_redirect,	HELP_REDIRECT,	0},
+	{"debuglvl",	fifo_debuglvl,	HELP_DEBUGLVL,	0},
 	{"adduser",	fifo_adduser,	HELP_ADDUSER,	0},
 	{"userinfo",	fifo_userinfo,	HELP_USERINFO,	0},
 	{"exit",	fifo_exit,	HELP_EXIT,	0},

Reply via email to