mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
fixed garbage in console for windows
This commit is contained in:
parent
380b56a89d
commit
e2a70873b8
@ -68,7 +68,14 @@ namespace i2p
|
|||||||
SetConsoleOutputCP(1251);
|
SetConsoleOutputCP(1251);
|
||||||
setlocale(LC_ALL, "Russian");
|
setlocale(LC_ALL, "Russian");
|
||||||
|
|
||||||
return Daemon_Singleton::start();
|
bool ret = Daemon_Singleton::start();
|
||||||
|
if (ret && IsLogToFile ())
|
||||||
|
{
|
||||||
|
// TODO: find out where this garbage to console comes from
|
||||||
|
SetStdHandle(STD_OUTPUT_HANDLE, INVALID_HANDLE_VALUE);
|
||||||
|
SetStdHandle(STD_ERROR_HANDLE, INVALID_HANDLE_VALUE);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DaemonWin32::stop()
|
bool DaemonWin32::stop()
|
||||||
|
6
Log.h
6
Log.h
@ -45,6 +45,7 @@ class Log: public i2p::util::MsgQueue<LogMsg>
|
|||||||
std::shared_ptr<std::ostream> GetLogStream () const { return m_LogStream; };
|
std::shared_ptr<std::ostream> GetLogStream () const { return m_LogStream; };
|
||||||
const std::string& GetTimestamp ();
|
const std::string& GetTimestamp ();
|
||||||
LogLevel GetLogLevel () { return m_MinLevel; };
|
LogLevel GetLogLevel () { return m_MinLevel; };
|
||||||
|
const std::string& GetFullFilePath () const { return m_FullFilePath; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -110,6 +111,11 @@ inline void ReopenLogFile ()
|
|||||||
g_Log->ReopenLogFile ();
|
g_Log->ReopenLogFile ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool IsLogToFile ()
|
||||||
|
{
|
||||||
|
return g_Log ? !g_Log->GetFullFilePath ().empty () : false;
|
||||||
|
}
|
||||||
|
|
||||||
template<typename TValue>
|
template<typename TValue>
|
||||||
void LogPrint (std::stringstream& s, TValue arg)
|
void LogPrint (std::stringstream& s, TValue arg)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user