Changeset 6847


Ignore:
Timestamp:
10/19/16 16:53:51 (3 years ago)
Author:
scott
Message:

Fixed writing of messages; cleaned up some logging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/data_sources/tideweb2ew/tideweb2ew.c

    r6841 r6847  
    6060        file: All are set in the GetConfig() routine found in getconfig.c 
    6161*/ 
    62 unsigned char TWModuleId;         /* module id for nq2ring */ 
    63 long RingKey;                    /* key to ring buffer nq2ring dumps data */ 
    64 long InRingKey;                    /* key to ring buffer nq2ring dumps data */ 
    65 long OutRingKey;                    /* key to ring buffer nq2ring dumps data */ 
     62unsigned char TWModuleId;         /* module id for tideweb2ew */ 
     63long InRingKey;                    /* key to ring buffer tideweb2ew reads data */ 
     64long OutRingKey;                    /* key to ring buffer tideweb2ew dumps data */ 
    6665int HeartBeatInt;                /* my heartbeat interval (secs) */ 
    6766int LogFile;                     /* generate a logfile? */ 
     
    204203        /* start EARTHWORM logging */ 
    205204        logit_init(argv[1], (short) TWModuleId, 256, LogFile); 
    206         logit("e", "%s: Version %s\n", progname, VER_NO); 
    207         logit("e", "%s: Read in config file %s\n", progname, argv[1]); 
     205        logit("t", "%s: Version %s\n", progname, VER_NO); 
     206        logit("t", "%s: Read in config file %s\n", progname, argv[1]); 
     207    logit("t", "%s: Primary = %s\n", progname, tg.item[0].weblog ); 
     208    if ( reporting > 1 ) 
     209       logit("t", "%s: Secondary = %s\n", progname, tg.item[1].weblog ); 
    208210 
    209211        /* EARTHWORM init earthworm connection at this point,  
     
    211213        */ 
    212214 
    213         /* Attach to Input shared memory ring 
    214          ************************************/ 
    215         tport_attach( &InRegion, InRingKey ); 
    216         logit( "e", "%s Attached to public memory region %s: %d\n", 
    217               whoami, InRingName, InRingKey ); 
    218  
    219215        /* Attach to Output shared memory ring 
    220216         *************************************/ 
    221217        tport_attach( &OutRegion, OutRingKey ); 
    222         logit( "e", "%s Attached to public memory region %s: %d\n", 
     218        logit( "t", "%s Attached to public memory region %s: %d\n", 
    223219              whoami, OutRingName, OutRingKey ); 
    224220 
     
    246242            int newSvalue = strcmp( tg.item[1].dateTimeSOH, tg.item[1].oldDateTimeSOH ); 
    247243            for ( i=0; i<numCodes; i++ ) 
    248                 if ( strcmp( tg.item[0].dateTimeSOH, tg.item[0].oldDateTimeSOH ) ) { 
     244                if ( strcmp( tg.item[i].dateTimeSOH, tg.item[i].oldDateTimeSOH ) ) { 
    249245                    tg_to_ring( &tg, newPvalue, newSvalue ); 
    250246                    break; 
     
    276272        /* should never reach here! */ 
    277273             
    278         logit("et","Done for now.\n"); 
     274        logit("t","Done for now.\n"); 
    279275  
    280276        tideweb2ew_die( -1, "clean exit" ); 
     
    533529    } 
    534530     
    535     if ( tport_putmsg( &OutRegion, &DataLogo, s - soh_msg, soh_msg ) != PUT_OK ) { 
     531    if ( tport_putmsg( &OutRegion, &SnwSohLogo, s - soh_msg, soh_msg ) != PUT_OK ) { 
    536532        logit("et", "%s: Fatal Error sending SNWSOH trace via tport_putmsg()\n", progname); 
    537533        ShutMeDown = TRUE; 
     
    554550    } 
    555551     
    556         if(Debug) logit("et", "Done sending to EARTHWORM  \n");  
     552        if(Debug) logit("t", "Done sending to EARTHWORM  \n");  
    557553          
    558554        return 0; 
     
    847843       DataLogo.type=TypeTrace2; 
    848844   setuplogo(&SnwSohLogo); 
    849        DataLogo.type=TypeSnwSoh; 
     845       SnwSohLogo.type=TypeSnwSoh; 
    850846   setuplogo(&OtherLogo); 
    851847    
     
    864860   } 
    865861   numCodes = reporting; 
    866    printf("%s: Primary = %s\n", progname, tg.item[0].weblog ); 
    867    if ( reporting > 1 ) 
    868        printf("%s: Secondary = %s\n", progname, tg.item[1].weblog ); 
    869862   return 0; 
    870863} 
Note: See TracChangeset for help on using the changeset viewer.