diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-03-11 07:24:10 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-03-11 07:24:10 +0000 |
commit | 8091484668b257e90c26d5df45f66602168ce405 (patch) | |
tree | 90b851fe0459219014cf42e9441f8f065e07debc /asterisk.c | |
parent | 3f4e0127ea54f7f0caa620853fabb408c3bae51b (diff) |
Add timestamping to console (bug #3653 with minor mods)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5163 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rwxr-xr-x | asterisk.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/asterisk.c b/asterisk.c index 2390f65dc..cb31376cf 100755 --- a/asterisk.c +++ b/asterisk.c @@ -81,6 +81,7 @@ int option_initcrypto=0; int option_nocolor; int option_dumpcore = 0; int option_cache_record_files = 0; +int option_timestamp = 0; int option_overrideconfig = 0; int option_reconnect = 0; int fully_booted = 0; @@ -1539,6 +1540,7 @@ static int show_cli_help(void) { printf(" -r Connect to Asterisk on this machine\n"); printf(" -R Connect to Asterisk, and attempt to reconnect if disconnected\n"); printf(" -t Record soundfiles in /var/tmp and move them where they belong after they are done.\n"); + printf(" -T Display the time in [Mmm dd hh:mm:ss] format for each line of output to the CLI.\n"); printf(" -v Increase verbosity (multiple v's = more verbose)\n"); printf(" -x <cmd> Execute command <cmd> (only valid with -r)\n"); printf("\n"); @@ -1611,6 +1613,9 @@ static void ast_readconfig(void) { /* verbose level (-v at startup) */ if (!strcasecmp(v->name, "verbose")) { option_verbose= atoi(v->value); + /* whether or not to force timestamping. (-T at startup) */ + } else if (!strcasecmp(v->name, "timestamp")) { + option_timestamp = ast_true(v->value); /* whether or not to support #exec in config files */ } else if (!strcasecmp(v->name, "execincludes")) { option_exec_includes = ast_true(v->value); @@ -1700,7 +1705,7 @@ int main(int argc, char *argv[]) } */ /* Check for options */ - while((c=getopt(argc, argv, "thfdvVqprRgcinx:U:G:C:")) != -1) { + while((c=getopt(argc, argv, "tThfdvVqprRgcinx:U:G:C:")) != -1) { switch(c) { case 'd': option_debug++; @@ -1738,6 +1743,9 @@ int main(int argc, char *argv[]) case 't': option_cache_record_files++; break; + case 'T': + option_timestamp++; + break; case 'x': option_exec++; xarg = optarg; |