mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2024-11-26 22:01:39 +00:00
Add entry type information at the start of each log file entry.
This commit is contained in:
parent
2efb4fcaf3
commit
3548f36e8c
1 changed files with 18 additions and 2 deletions
20
src/Log.cpp
20
src/Log.cpp
|
@ -31,7 +31,23 @@ void Log::open(const std::string& path)
|
|||
|
||||
void Log::write(Type type, const char* text)
|
||||
{
|
||||
std::cerr << "log " << text << std::endl;
|
||||
::write(m_fd,text,strlen(text));
|
||||
switch (type)
|
||||
{
|
||||
case Info:
|
||||
std::cerr << "INFO ";
|
||||
break;
|
||||
case Warn:
|
||||
std::cerr << "WARN ";
|
||||
break;
|
||||
case Error:
|
||||
std::cerr << "ERROR ";
|
||||
break;
|
||||
}
|
||||
std::cerr << text << std::endl;
|
||||
|
||||
if (m_fd >= 0)
|
||||
{
|
||||
::write(m_fd,text,strlen(text));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue