55 mLogFile <<
"</body></html>" << std::endl;
80 if (!userLogPath.empty())
90 std::cerr <<
"Unable to create the log directory : \"" << logDir <<
"\". The log file will be written to the current working directory if possible." << std::endl;
103 std::cerr <<
"Could not open the Log file \"" << fullLogPath <<
"\"" << std::endl;
111 mLogFile <<
"<pre><h3 align=\"center\"" 112 "<font color=#000000><b> Always </b></font>" 113 "<font color=#A000A0><b> Debug </b></font>" 114 "<font color=#00A000><b> Information </b></font>" 115 "<font color=#CF6F00><b> Warning </b></font>" 116 "<font color=#C00000><b> Error </b></font></h3></pre><hr>" 120 mLogFile <<
"<br><br>" << std::endl;
151 color =
"<b><font color=#A000A0>";
155 color =
"<b><font color=#00A000>";
159 color =
"<b><font color=#C00000>";
163 color =
"<b><font color=#CF6F00>";
166 case Logging::LogLevel::LOG_ALWAYS:
167 color =
"<b><font color=#000000>";
171 static const std::string htmlNewline(
"<br>\n");
172 std::string htmlMsg(logData.
msg);
174 for (
size_t lineEnd = htmlMsg.find(
'\n');
175 lineEnd != std::string::npos;
176 lineEnd = htmlMsg.find(
'\n', lineEnd))
178 htmlMsg.replace(lineEnd, 1, htmlNewline);
179 lineEnd += htmlNewline.size() + 1;
198 if (!logData.
method.empty())
203 if (!logData.
file.empty())
207 if (logData.
line > 0)
213 mLogFile <<
"]" <<
"</font></b><br>" << std::endl;
std::string logName
The frame number.
std::string file
The name of the Log instance (could be empty)
LogWriterFile()
Default constructor.
This is the exception class used throughout the engine.
int line
The calling method of the message.
void SetToLocalTime()
Changes time to be system local time.
static const std::string GetFileName()
Get the current filename of the log file.
void ResetOpenFail()
A utility function to reset the OpenFailed flag after a file failure.
static const std::string GetLogLevelString(LogLevel logLevel)
Gets log level string.
void LogHorizRule()
Logs horiz rule.
void OpenFile()
Opens the file.
virtual ~LogWriterFile()
Destructor.
static const TimeFormat LOCAL_DATE_AND_TIME_FORMAT
LOCAL_DATE_AND_TIME_FORMAT: 04-18-08 13:22:50.
static const std::string & GetTitle()
Get the current HTML title string.
std::string method
The source file of the message.
TR_UTIL_EXPORT std::string GetLogPath()
Get the folder where TR will save and store the log files It is the same as GetUserDataPath() by defa...
static FileUtils & GetInstance()
Character separating the parts of a file path.
static const std::string DEFAULT_LOG_FOLDER
The folder path that is appended to the User Data folder (PathUtil::GetUserTCDataFolder()) ...
std::string ToString() const
The no parameter version of ToString uses the internal TimeFormat, see the TimeFormat enumeration abo...
void MakeDirectoryEX(std::string strDir)
A more powerful version of the standard mkdir.
unsigned frameNumber
Time of message.
std::string msg
The line number of the source code of the message.
void TimeTag(std::string prefix)
trUtil::DateTime time
Log level.
trUtil::Logging::LogLevel logLevel
static const char PATH_SEPARATOR
virtual void LogMessage(const LogData &logData)
Logs a message.
bool IsOpenFailed()
Returns true if opening a file failed.