Browse Source

Refactored command comment reporting

git-svn-id: https://svn.microneil.com/svn/SNF4CGP/trunk@30 59e8e3e7-56fa-483b-b4b4-fa6ab0af3dfc
master
madscientist 15 years ago
parent
commit
3493f12b56
2 changed files with 17 additions and 6 deletions
  1. 16
    6
      SNF4CGP/JobPool.cpp
  2. 1
    0
      SNF4CGP/JobPool.hpp

+ 16
- 6
SNF4CGP/JobPool.cpp View File

OutputBuffer.append(O.str()); OutputBuffer.append(O.str());
} }
void Job::generateCommandCommentPrefix(ostringstream& O) {
O << "* SNF4CGP[" << CurrentCommand.Number << "] ";
}
void Job::emitOK() { void Job::emitOK() {
ostringstream O; ostringstream O;
O << CurrentCommand.Number << " OK" << endl; O << CurrentCommand.Number << " OK" << endl;
void Job::emitLogComment() { void Job::emitLogComment() {
ostringstream O; ostringstream O;
O << "* SNF4CGP[" << CurrentCommand.Number << "] Comment: " << ScanResultConfiguration.LogComment << endl;
generateCommandCommentPrefix(O);
O << "Comment: " << ScanResultConfiguration.LogComment << endl;
OutputBuffer.append(O.str()); OutputBuffer.append(O.str());
} }
void Job::emitXMLLogData() { void Job::emitXMLLogData() {
ostringstream O; ostringstream O;
O << "* SNF4CGP[" << CurrentCommand.Number << "] XML Scan log data: " << endl;
generateCommandCommentPrefix(O);
O << "XML Scan log data: " << endl;
convertLogLinesToComments(O, XMLLogData); convertLogLinesToComments(O, XMLLogData);
OutputBuffer.append(O.str()); OutputBuffer.append(O.str());
} }
void Job::emitClassicLogData() { void Job::emitClassicLogData() {
ostringstream O; ostringstream O;
O << "* SNF4CGP[" << CurrentCommand.Number << "] Classic Scan log data: " << endl;
generateCommandCommentPrefix(O);
O << "Classic Scan log data: " << endl;
convertLogLinesToComments(O, ClassicLogData); convertLogLinesToComments(O, ClassicLogData);
OutputBuffer.append(O.str()); OutputBuffer.append(O.str());
} }
void Job::emitMessageMovedTo(string& Destination) { void Job::emitMessageMovedTo(string& Destination) {
ostringstream O; ostringstream O;
O << "* SNF4CGP[" << CurrentCommand.Number << "] Moved message to " << Destination << endl;
generateCommandCommentPrefix(O);
O << "Moved message to " << Destination << endl;
OutputBuffer.append(O.str()); OutputBuffer.append(O.str());
} }
void Job::emitException(const string& What) { void Job::emitException(const string& What) {
ostringstream O; ostringstream O;
O << "* SNF4CGP[" << CurrentCommand.Number << "] Exception: " << What << endl;
generateCommandCommentPrefix(O);
O << "Exception: " << What << endl;
OutputBuffer.append(O.str()); OutputBuffer.append(O.str());
} }
void Job::emitUnknownException() { void Job::emitUnknownException() {
ostringstream O; ostringstream O;
O << "* SNF4CGP[" << CurrentCommand.Number << "] Unknown Exception!" << endl;
generateCommandCommentPrefix(O);
O << "Unknown Exception!" << endl;
OutputBuffer.append(O.str()); OutputBuffer.append(O.str());
} }

+ 1
- 0
SNF4CGP/JobPool.hpp View File

//// Utility methods //// Utility methods
void emitComment(const string& Comment); void emitComment(const string& Comment);
void generateCommandCommentPrefix(ostringstream& O);
void emitOK(); void emitOK();
void emitINTF(); void emitINTF();

Loading…
Cancel
Save