diff options
author | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2011-10-11 13:09:24 +0200 |
---|---|---|
committer | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2011-10-11 13:09:24 +0200 |
commit | 9585f876733b62fb29aaeb163f0f8c408765c9e3 (patch) | |
tree | fefb56af129e938776002623e89dffd23784deeb /src/examples/dlt-example-user.c | |
parent | 95d606145751f160505660888e334518c0802470 (diff) | |
download | DLT-daemon-9585f876733b62fb29aaeb163f0f8c408765c9e3.tar.gz |
Added new API dlt_set_log_mode to enable/disable internal/external trace.
Diffstat (limited to 'src/examples/dlt-example-user.c')
-rwxr-xr-x | src/examples/dlt-example-user.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/examples/dlt-example-user.c b/src/examples/dlt-example-user.c index 98d4e3a..62b539f 100755 --- a/src/examples/dlt-example-user.c +++ b/src/examples/dlt-example-user.c @@ -111,6 +111,7 @@ void usage() printf(" -n count Number of messages to be generated (Default: 10)\n"); printf(" -g Switch to non-verbose mode (Default: verbose mode)\n"); printf(" -a Enable local printing of DLT messages (Default: disabled)\n"); + printf(" -m mode Set log mode 0=off,1=external,2=internal,3=both\n"); } /** @@ -124,6 +125,7 @@ int main(int argc, char* argv[]) char *dvalue = 0; char *fvalue = 0; char *nvalue = 0; + char *mvalue = 0; char *message = 0; int index; @@ -135,7 +137,7 @@ int main(int argc, char* argv[]) opterr = 0; - while ((c = getopt (argc, argv, "vgad:f:n:")) != -1) + while ((c = getopt (argc, argv, "vgad:f:n:m:")) != -1) { switch (c) { @@ -169,6 +171,11 @@ int main(int argc, char* argv[]) nvalue = optarg; break; } + case 'm': + { + mvalue = optarg; + break; + } case '?': { if (optopt == 'd' || optopt == 'f' || optopt == 'n') @@ -224,6 +231,13 @@ int main(int argc, char* argv[]) text = message; + if(mvalue) + { + printf("Set log mode to %d\n",atoi(mvalue)); + dlt_set_log_mode(atoi(mvalue)); + } + + if (gflag) { DLT_NONVERBOSE_MODE(); |