mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
#355. reopen log file by SIGHUP
This commit is contained in:
8
Log.h
8
Log.h
@@ -39,6 +39,7 @@ class Log: public i2p::util::MsgQueue<LogMsg>
|
||||
~Log () {};
|
||||
|
||||
void SetLogFile (const std::string& fullFilePath);
|
||||
void ReopenLogFile ();
|
||||
void SetLogLevel (const std::string& level);
|
||||
void SetLogStream (std::shared_ptr<std::ostream> logStream);
|
||||
std::shared_ptr<std::ostream> GetLogStream () const { return m_LogStream; };
|
||||
@@ -51,6 +52,7 @@ class Log: public i2p::util::MsgQueue<LogMsg>
|
||||
|
||||
private:
|
||||
|
||||
std::string m_FullFilePath; // empty if stream
|
||||
std::shared_ptr<std::ostream> m_LogStream;
|
||||
enum LogLevel m_MinLevel;
|
||||
std::string m_Timestamp;
|
||||
@@ -102,6 +104,12 @@ inline void SetLogLevel (const std::string& level)
|
||||
g_Log->SetLogLevel(level);
|
||||
}
|
||||
|
||||
inline void ReopenLogFile ()
|
||||
{
|
||||
if (g_Log)
|
||||
g_Log->ReopenLogFile ();
|
||||
}
|
||||
|
||||
template<typename TValue>
|
||||
void LogPrint (std::stringstream& s, TValue arg)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user