move testout to ngcore

This commit is contained in:
Christopher Lackner 2019-05-28 13:51:53 +02:00
parent a9db1f60c1
commit 0a08450bfa
8 changed files with 14 additions and 8 deletions

View File

@ -13,6 +13,7 @@
namespace ngcore
{
std::ostream* testout = new std::ostream(nullptr); // NOLINT
void Logger::log(level::level_enum level, std::string && s)
{

View File

@ -31,6 +31,8 @@ namespace spdlog
namespace ngcore
{
NGCORE_API extern std::ostream* testout; // NOLINT
namespace level
{
enum level_enum

View File

@ -23,7 +23,6 @@ namespace netgen
// #include <iostream>
/** output stream for testing.
testout is opened by main */
DLL_HEADER extern ostream * testout;
/** use instead of cout */
DLL_HEADER extern ostream * mycout;

View File

@ -483,7 +483,6 @@ extern "C" {
#include <iostream>
namespace netgen
{
DLL_HEADER extern std::ostream * testout;
DLL_HEADER extern int printmessage_importance;
}

View File

@ -18,7 +18,6 @@ namespace netgen
// testout -> clear(ios::failbit);
// ostream * testout = &cout;
ostream * testout = new ostream(0);
// NetgenOutStream * testout = new NetgenOutStream;

View File

@ -147,7 +147,10 @@ int main(int argc, char ** argv)
if ( netgen::id == 0 )
{
if (parameters.StringFlagDefined ("testout"))
netgen::testout = new ofstream (parameters.GetStringFlag ("testout", "test.out"));
{
delete ngcore::testout;
ngcore::testout = new ofstream (parameters.GetStringFlag ("testout", "test.out"));
}
#ifdef SOCKETS

View File

@ -72,7 +72,10 @@ void ParallelRun()
MPI_Comm_rank(MPI_COMM_WORLD, &id);
if (parameters.StringFlagDefined ("testout"))
testout = new ofstream (string("testout_proc") + id );
{
delete testout;
testout = new ofstream (string("testout_proc") + id );
}

View File

@ -82,7 +82,7 @@ namespace nglib
mycout = &cout;
myerr = &cerr;
// netgen::testout->SetOutStream (new ofstream ("test.out"));
testout = new ofstream ("test.out");
// testout = new ofstream ("test.out");
}