Skip to content
Snippets Groups Projects
Commit 41043069 authored by Mark Jenkinson's avatar Mark Jenkinson
Browse files

Removed dead Log.h and Log.cc, leaving log.h and log.cc

parent ec1cacd4
No related branches found
No related tags found
No related merge requests found
/* Log.cc
Mark Woolrich, FMRIB Image Analysis Group
Copyright (C) 1999-2000 University of Oxford */
/* CCOPYRIGHT */
#include "Log.h"
#include <iostream>
#include <fstream>
#include <strstream>
#include <string>
namespace Utilities {
Log* Log::logger = NULL;
int Log::count = 0;
template<class t> string tostring(const t obj)
{
char strc[100];
ostrstream str(strc,100);
str << obj << '\0';
return string(strc);
}
// SPECIFIC INSTANTIATIONS
template<int> string tostring(const int obj);
void Log::makeDir(const string& pdirname, const string& plogfilename)
{
dir = pdirname;
logfilename = plogfilename;
// make directory to place results into:
// keep adding "+" until directory is made:
int count = 0;
while(true)
{
if(count >= 20)
{
string s("Cannot create directory " + dir);
throw Exception(s.c_str());
}
int ret = system(("mkdir "+ dir + " 2>/dev/null").c_str());
if(ret == 0)
{
break;
}
dir = dir + "+";
count++;
}
// setup logfile
logfileout.open((dir + "/" + logfilename).c_str(), ios::out);
logEstablished = true;
}
void Log::setDir(const string& pdirname, const string& plogfilename)
{
dir = pdirname;
logfilename = plogfilename;
// setup logfile
logfileout.open((dir + "/" + logfilename).c_str(), ios::out);
logEstablished = true;
}
}
/* log.h
Mark Woolrich, FMRIB Image Analysis Group
Copyright (C) 1999-2000 University of Oxford */
/* CCOPYRIGHT */
#include "log.h"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment