Browse Source

- using log instead cout

master
Andreas Romeyke 2 years ago
parent
commit
7285110499
1 changed files with 7 additions and 6 deletions
  1. +7
    -6
      src/lib/bagmetadata.cpp

+ 7
- 6
src/lib/bagmetadata.cpp View File

@@ -19,8 +19,8 @@ Bagmetadata::Bagmetadata( string basedir ) {
string filename = basedir + "bag-info.txt";
fs::path p{ filename };
fs::file_status s = fs::status( p );
cout << "path "<< p.string() << endl;
cout << "is file: "<< fs::is_regular_file( s) << endl;
log << "path "<< p.string() << endl;
log << "is file: "<< fs::is_regular_file( s) << endl;
if (fs::is_regular_file( s)) {
this->exist_bagmetadata_file = true;
// map entries
@@ -70,8 +70,8 @@ Bagmetadata::Bagmetadata( string basedir ) {
}

Bagmetadata::metadata[ key ] = value;
// DEBUG:
cout << "KEY='"<<key<<"' value='"<<value << "'" <<endl;
// DEBUG:
log << "KEY='"<<key<<"' value='"<<value << "'" <<endl;
}
}
} else { // no file
@@ -98,7 +98,7 @@ bool Bagmetadata::has_PayloadOxum() {
map<string, string>::iterator it;
it = this->metadata.find("Payload-Oxum");
if (it != this->metadata.end()) {
cout << "Oxum is: " << it->second << endl;
log << "Oxum is: " << it->second << endl;
return true;
}
return false;
@@ -146,6 +146,7 @@ bool Bagmetadata::store( string basedir ) {
}
return true;
}

void Bagmetadata::get_logstream( stringstream & log ) {
log << this->log.rdbuf();
}
@@ -307,7 +308,7 @@ string Bagmetadata::get_InternalSenderDescription() {
map<string, string>::iterator it;
it = this->metadata.find("InternalSenderDescription");
if(it != this->metadata.end()) { return it->second; }
cout <<"ITD: NOT FOUND"<< endl;
log <<"ITD: NOT FOUND"<< endl;
return "NOTFOUND";
}



Loading…
Cancel
Save