Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xoutSetup LogOnlyXout, CoutOnlyXout should not ignore setupLogging, setupCout parameters #794

Open
N-Dekker opened this issue Feb 3, 2023 · 0 comments
Assignees

Comments

@N-Dekker
Copy link
Member

N-Dekker commented Feb 3, 2023

Please check elxElastixMain.cxx commit 763327c

if( setupLogging )
{
/** Open the logfile for writing. */
g_LogFileStream.open( logfilename );
if ( !g_LogFileStream.is_open() )
{
std::cerr << "ERROR: LogFile cannot be opened!" << std::endl;
return 1;
}
}
/** Set std::cout and the logfile as outputs of xout. */
if( setupLogging )
{
returndummy |= xout.AddOutput("log", &g_LogFileStream);
}
if( setupCout )
{
returndummy |= xout.AddOutput("cout", &std::cout);
}
/** Set outputs of LogOnly and CoutOnly. */
returndummy |= g_LogOnlyXout.AddOutput( "log", &g_LogFileStream );
returndummy |= g_CoutOnlyXout.AddOutput( "cout", &std::cout );

It seems to me that the following two statements should be surrounded by if( setupLogging ) and if( setupCout ), respectively. Right?

returndummy |= g_LogOnlyXout.AddOutput( "log", &g_LogFileStream );
returndummy |= g_CoutOnlyXout.AddOutput( "cout", &std::cout );

The main question is: Do we want no console output at all from the logger, when the ITKElastix/SimpleITK elastix library property LogToConsole = false? Or do we still want logging directed to "coutonly" to appear on the console anyway?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants