cli cerr/cout flush
Write less extraneous information to stdout, and ensure flush() at opportune times
This commit is contained in:
1 parent
086501a1b0
commit
090bf5ff97
6 files changed
+12
-8
No files matched your search
+2
-1
@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
|
||||
auto ctxt(client::Context::fromEnv());
|
||||
|
||||
if(verbose)
|
||||
std::cout<<"Effective config\n"<<ctxt.config();
|
||||
std::cerr<<"Effective config\n"<<ctxt.config();
|
||||
|
||||
epicsEvent done;
|
||||
int ret=2;
|
||||
@@ -131,6 +131,7 @@ int main(int argc, char *argv[])
|
||||
auto val = result();
|
||||
if(val)
|
||||
std::cout<<val;
|
||||
std::cout.flush();
|
||||
ret=0;
|
||||
}catch(std::exception& e){
|
||||
std::cerr<<ERL_ERROR " "<<typeid(e).name()<<" : "<<e.what()<<"\n";
|
||||
|
||||
+2
-1
@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
|
||||
auto ctxt(client::Context::fromEnv());
|
||||
|
||||
if(verbose)
|
||||
std::cout<<"Effective config\n"<<ctxt.config();
|
||||
std::cerr<<"Effective config\n"<<ctxt.config();
|
||||
|
||||
std::list<std::shared_ptr<client::Operation>> ops;
|
||||
|
||||
@@ -115,6 +115,7 @@ int main(int argc, char *argv[])
|
||||
.format()
|
||||
.format(format)
|
||||
.arrayLimit(arrLimit);
|
||||
std::cout.flush();
|
||||
|
||||
if(remaining.fetch_sub(1)==1)
|
||||
done.signal();
|
||||
|
||||
+3
-2
@@ -76,7 +76,7 @@ int main(int argc, char *argv[])
|
||||
auto ctxt(client::Context::fromEnv());
|
||||
|
||||
if(verbose)
|
||||
std::cout<<"Effective config\n"<<ctxt.config();
|
||||
std::cerr<<"Effective config\n"<<ctxt.config();
|
||||
|
||||
std::list<std::shared_ptr<client::Operation>> ops;
|
||||
|
||||
@@ -92,8 +92,9 @@ int main(int argc, char *argv[])
|
||||
std::cout<<" from "<<result.peerName()<<"\n"<<result()
|
||||
.format()
|
||||
.showValue(false);
|
||||
std::cout.flush();
|
||||
}catch(std::exception& e){
|
||||
std::cout<<" Error: "<<e.what()<<"\n";
|
||||
std::cout<<" Error: "<<e.what()<<std::endl;
|
||||
}
|
||||
|
||||
if(remaining.fetch_sub(1)==1)
|
||||
|
||||
+1
-1
@@ -173,7 +173,7 @@ int main(int argc, char *argv[])
|
||||
if(top["implLang"].as(temp)) {
|
||||
std::cout<<" lang=\""<<escape(temp)<<"\"";
|
||||
};
|
||||
std::cout<<"\n";
|
||||
std::cout<<std::endl;
|
||||
|
||||
} else { // channels
|
||||
if(verbose)
|
||||
|
||||
+2
-1
@@ -108,7 +108,7 @@ int main(int argc, char *argv[])
|
||||
auto ctxt(client::Context::fromEnv());
|
||||
|
||||
if(verbose)
|
||||
std::cout<<"Effective config\n"<<ctxt.config();
|
||||
std::cerr<<"Effective config\n"<<ctxt.config();
|
||||
|
||||
// space for every subscription and one more for SigInt
|
||||
MPMCFIFO<std::shared_ptr<client::Subscription>> workqueue(argc-optind+1);
|
||||
@@ -157,6 +157,7 @@ int main(int argc, char *argv[])
|
||||
std::cout<<update.format()
|
||||
.format(format)
|
||||
.arrayLimit(arrLimit);
|
||||
std::cout.flush();
|
||||
|
||||
}catch(client::Finished& conn) {
|
||||
log_info_printf(app, "%s POP Finished\n", name.c_str());
|
||||
|
||||
+2
-2
@@ -113,7 +113,7 @@ int REALMAIN(int argc, char *argv[])
|
||||
auto ctxt(client::Context::fromEnv());
|
||||
|
||||
if(verbose)
|
||||
std::cout<<"Effective config\n"<<ctxt.config();
|
||||
std::cerr<<"Effective config\n"<<ctxt.config();
|
||||
|
||||
epicsEvent done;
|
||||
int ret=0;
|
||||
@@ -143,7 +143,7 @@ int REALMAIN(int argc, char *argv[])
|
||||
if(verbose) {
|
||||
std::cout<<"Writing fields:\n";
|
||||
Indented I(std::cout);
|
||||
std::cout<<val.format().delta()<<"\n";
|
||||
std::cout<<val.format().delta()<<std::endl;
|
||||
}
|
||||
return val;
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user