Changeset 111 for hvcontrol/src
- Timestamp:
- 09/23/09 11:07:01 (15 years ago)
- Location:
- hvcontrol/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
hvcontrol/src/ProcessIO.cc
r100 r111 554 554 va_list ArgumentPointer; 555 555 va_start(ArgumentPointer, Format); 556 PrintMessage( Target, Format, ArgumentPointer);556 PrintMessage(Format, ArgumentPointer, Target); 557 557 va_end(ArgumentPointer); 558 558 } … … 562 562 va_list ArgumentPointer; 563 563 va_start(ArgumentPointer, Format); 564 if (CmdFromSocket) PrintMessage( MsgToSocket|MsgToLog, Format, ArgumentPointer);565 else PrintMessage( MsgToConsole|MsgToLog, Format, ArgumentPointer);564 if (CmdFromSocket) PrintMessage(Format, ArgumentPointer, MsgToSocket|MsgToLog); 565 else PrintMessage(Format, ArgumentPointer, MsgToConsole|MsgToLog); 566 566 va_end(ArgumentPointer); 567 567 } 568 568 569 569 // Function doing the actual printing work 570 void ProcessIO::PrintMessage(int Target, const char *Format, va_list ArgumentPointer) { 570 // It is important that Target is here the last argument, otherwise 571 // there can be confusion with the variadic versions (this function is 572 // called instead of PrintMessage(int, const char *, ...) 573 void ProcessIO::PrintMessage(const char *Format, va_list ArgumentPointer, int Target) { 571 574 572 575 char Textbuffer[MAX_COM_SIZE]; … … 592 595 if(Textbuffer[i] == '\r') Textbuffer[i] = '\n'; 593 596 } 594 fprintf(Logfile, "%s", Textbuffer); 597 time_t Time; 598 strftime(Textbuffer+strlen(Textbuffer)+1,MAX_COM_SIZE-strlen(Textbuffer)-1, "%d/%m/%y %X", localtime(&(Time=time(NULL)))); 599 fprintf(Logfile, "%s: %s", Textbuffer+strlen(Textbuffer)+1, Textbuffer); 595 600 fflush(Logfile); 596 601 } -
hvcontrol/src/ProcessIO.h
r100 r111 65 65 void PrintMessage(int, const char *, ...); 66 66 void PrintMessage(const char *, ...); 67 void PrintMessage( int, const char *, va_list);67 void PrintMessage(const char *, va_list, int); 68 68 void CommandControl(char*); 69 69 bool RampVoltage(unsigned int, int, int, int);
Note:
See TracChangeset
for help on using the changeset viewer.