12 int main(
int argc,
char *argv[])
29 logport = RTS_LOG_PORT_TEST ;
30 strcpy(logdest,
"172.16.0.1") ;
31 strcpy(loglevel,INFO);
32 strcpy(filearg,
"shell.sh") ;
33 strcpy(cmdarg,
"shell") ;
40 memset(logstr,0,
sizeof(logstr)) ;
42 while((c = getopt(argc,argv,
"c:d:p:w:h:f:l:i")) != EOF) {
45 strcpy(cmdarg,optarg) ;
48 strcpy(loglevel,optarg) ;
51 rtsLogOutput(atoi(optarg)) ;
54 logport = atoi(optarg) ;
57 strcpy(logdest,optarg) ;
60 strcpy(filearg,optarg) ;
63 linenum = atoi(optarg) ;
70 fprintf(stderr,
"Usage %s: [-d loglevel] [-p port] [-w output] [-h log host] [-c cmd]\n",argv[0]) ;
75 rtsLogAddCmd(cmdarg) ;
76 rtsLogAddDest(logdest,logport) ;
80 if(fgets(buff,
sizeof(buff),stdin)==0) continue ;
82 sprintf(logstr,
"COLOR%s: %s [line %d]: %s",loglevel,filearg,linenum,buff) ;
83 rtsLogUnix_v(logstr) ;
88 sprintf(logstr,
"COLOR%s: %s [line %d]:",loglevel,filearg,linenum) ;
90 while(optind < argc) {
92 strcat(logstr,argv[optind]) ;
98 rtsLogUnix_v(logstr) ;