[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] [C++] output til cerr og logfil



Kristian Nørgaard wrote:

> Jeg har et C++ program som skriver en del til skærmen med
> cerr << "Bla bla .. " << endl;
> 
> Er der en standard måde at fange al denne information, så den også
> skrives til en logfil?
> 
> Eller er vi ude i at jeg skal lave samtlige cerr statements om til en
> makro/funktion, der skriver den samme streng til hhv. cerr og logfil?
> 
> - Kristian

tee kankse kan hjälpa dig? 
man tee

I korthet så fångar tee allt den får på stdin och skickar
till stdout + en log. då kan du lämna loggning till tee, och bara skicka ut 
till stdout

prog | tee en_logfil.log

ska skicka allt från prog's stdout till stdout + en_logfil.log

prog 2>&1 | tee en_logfil.log
tar även med stderr

/Björn


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *