Posted: Sun Apr 06, 2003 4:21 am Post subject: [Asterisk-Dev] Time stamps
A couple thoughts on your patches:
I think the prompt might could be better addressed as an asterisk
command line option and/or environmental variable with
formatting. For example, username and hostname of the running
process may be beneficial to people running multiple asterisk
servers. Instead of hardcoding the prompt, it should probably be
customizable from outside the source.
Ditto for the logger. For some active servers, coding the time
is just going to be clutter in the logs. For other less active
servers, it might even be good to have the date, in addition to
the time.
Also, you should probably use the POSIX gettimeofday(2),
instead of the obsolete time(2) call.
-Tilghman
On Saturday 05 April 2003 19:59, Steve Brown wrote:
Posted: Sun Apr 06, 2003 11:07 am Post subject: [Asterisk-Dev] Time stamps
Agreed.
Back to the drawing board.
Steve
Tilghman Lesher wrote:
Quote:
A couple thoughts on your patches:
I think the prompt might could be better addressed as an asterisk
command line option and/or environmental variable with
formatting. For example, username and hostname of the running
process may be beneficial to people running multiple asterisk
servers. Instead of hardcoding the prompt, it should probably be
customizable from outside the source.
Ditto for the logger. For some active servers, coding the time
is just going to be clutter in the logs. For other less active
servers, it might even be good to have the date, in addition to
the time.
Also, you should probably use the POSIX gettimeofday(2),
instead of the obsolete time(2) call.
-Tilghman
On Saturday 05 April 2003 19:59, Steve Brown wrote:
Posted: Mon Apr 14, 2003 1:02 am Post subject: [Asterisk-Dev] Time stamps
This is a multi-part message in MIME format.
--------------030400070008090407020402
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Tilghman Lesher wrote:
Quote:
A couple thoughts on your patches:
I think the prompt might could be better addressed as an asterisk
command line option and/or environmental variable with
formatting. For example, username and hostname of the running
process may be beneficial to people running multiple asterisk
servers. Instead of hardcoding the prompt, it should probably be
customizable from outside the source.
Ditto for the logger. For some active servers, coding the time
is just going to be clutter in the logs. For other less active
servers, it might even be good to have the date, in addition to
the time.
Also, you should probably use the POSIX gettimeofday(2),
instead of the obsolete time(2) call.
return(prompt);
}
@@ -1122,7 +1132,7 @@
}
*/
/* Check for options */
- while((c=getopt(argc, argv, "hfdvqprgcinx:C:")) != EOF) {
+ while((c=getopt(argc, argv, "hfdvqprtgcinx:C:")) != EOF) {
switch(c) {
case 'd':
option_debug++;
@@ -1144,6 +1154,9 @@
break;
case 'p':
option_highpriority++;
+ break;
+ case 't':
+ option_timestamp++;
break;
case 'v':
option_verbose++;
Index: cli.c
===================================================================
RCS file: /usr/cvsroot/asterisk/cli.c,v
retrieving revision 1.3
diff -u -r1.3 cli.c
--- cli.c 9 Apr 2003 04:00:43 -0000 1.3
+++ cli.c 14 Apr 2003 00:55:48 -0000
@@ -82,6 +82,12 @@
" Sets level of verbose messages to be displayed. 0 means\n"
" no messages should be displayed.\n";
+static char set_timestamp_help[] =
+"Usage: set timestamp [on|off|format <dateformat>]\n"
+" Turns logging timestamps on/off.\n"
+" The format option sets the strftime format string.\n"
+" A missing argument inverts the current state.\n";
+
static char softhangup_help[] =
"Usage: soft hangup <channel>\n"
" Request that a channel be hung up. The hangup takes effect\n"
@@ -106,6 +112,37 @@
return RESULT_SUCCESS;
}
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum