Skip to content

Commit

Permalink
Log: remove deprecations marked TODO. Refs monero-project#214
Browse files Browse the repository at this point in the history
  • Loading branch information
anonimal committed Aug 19, 2016
1 parent 85415fe commit 87febb7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 103 deletions.
36 changes: 0 additions & 36 deletions src/core/util/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,6 @@ class LogStream : public std::ostream {
LogStream(
LogStreamImpl* impl);

// TODO(anonimal): unused, remove. We can implement differently if needed.
/*/// @brief Enable logging on this stream
void Enable();
/// @brief Disable logging on this stream
void Disable();
/// @brief Flush this log stream
LogStream& Flush();
/// @brief Check if this stream is enabled
/// @return True if stream is enabled
bool IsEnabled();*/

private:
std::unique_ptr<LogStreamImpl> m_LogStreamPimpl;
};
Expand All @@ -158,10 +144,6 @@ class Logger {
/// @return Reference to debug level log stream
LogStream& Debug();

// TODO(anonimal): unused, remove. We can implement differently if needed.
/*/// @brief Flush pending log events
void Flush();*/

private:
std::unique_ptr<LoggerImpl> m_LoggerPimpl;
};
Expand All @@ -185,12 +167,6 @@ class Log {
/// @return Shared pointer to default logger
std::shared_ptr<Logger> GetDefaultLogger();

// TODO(anonimal): unused, remove. We can implement differently if needed.
/*/// @brief Create a logger's given name
std::unique_ptr<Logger> New(
const std::string& name,
const std::string& channel);*/

private:
std::shared_ptr<LogImpl> m_LogPimpl;
std::shared_ptr<Logger> m_DefaultLogger;
Expand Down Expand Up @@ -286,16 +262,4 @@ void DeprecatedLogPrint(

#define LogPrint DeprecatedLogPrint

// TODO(anonimal): no longer needed, remove all of these deprecations
void DeprecatedStartLog(
const std::string& full_file_path);

void DeprecatedStartLog(
std::ostream* stream);

void DeprecatedStopLog();

#define StartLog DeprecatedStartLog
#define StopLog DeprecatedStopLog

#endif // SRC_CORE_UTIL_LOG_H_
67 changes: 0 additions & 67 deletions src/core/util/pimpl/log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -234,19 +234,6 @@ class LogStreamImpl : public std::streambuf {

~LogStreamImpl() {}

// TODO(anonimal): unused, remove. We can implement differently if needed.
/*void Enable() {
m_Enabled = true;
}
bool IsEnabled() {
return m_Enabled;
}
void Disable() {
m_Enabled = false;
}*/

/// @note Not thread safe
void Flush() {
BOOST_LOG_SEV(m_Log, m_Level) << m_Str.get();
Expand Down Expand Up @@ -297,24 +284,6 @@ LogStream::LogStream(
: std::ostream(impl),
m_LogStreamPimpl(impl) {}

// TODO(anonimal): unused, remove. We can implement differently if needed.
/*void LogStream::Enable() {
m_LogStreamPimpl->Enable();
}
void LogStream::Disable() {
m_LogStreamPimpl->Disable();
}
LogStream& LogStream::Flush() {
m_LogStreamPimpl->Flush();
return *this;
}
bool LogStream::IsEnabled() {
return m_LogStreamPimpl->IsEnabled();
}*/

/**
*
* Logger implementation and definitions
Expand Down Expand Up @@ -360,11 +329,6 @@ class LoggerImpl {
return GetLogStream(m_Debug, m_DebugMtx);
}

// TODO(anonimal): unused, remove. We can implement differently if needed.
/*void Flush() {
g_LogOutStreamSink->flush();
}*/

private:
/// @brief Lock mutex and return log stream
/// @return Reference to LogStream
Expand Down Expand Up @@ -404,11 +368,6 @@ LogStream& Logger::Debug() {
return m_LoggerPimpl->Debug();
}

// TODO(anonimal): unused, remove. We can implement differently if needed.
/*void Logger::Flush() {
m_LoggerPimpl->Flush();
}*/

/**
*
* Log implementation and definitions
Expand Down Expand Up @@ -533,13 +492,6 @@ std::shared_ptr<Logger> Log::GetDefaultLogger() {
return m_DefaultLogger;
}

// TODO(anonimal): unused, remove. We can implement differently if needed.
/*std::unique_ptr<Logger> Log::New(
const std::string& name,
const std::string& channel) {
return std::unique_ptr<Logger>(new Logger(new LoggerImpl(name, channel)));
}*/

std::ostream& operator<<(
std::ostream& out_stream,
LogLevel log_level) {
Expand All @@ -560,22 +512,3 @@ std::ostream& operator<<(
} // namespace log
} // namespace util
} // namespace i2p

// TODO(anonimal): no longer needed, remove all of these deprecations
/**
*
* Deprecated Logger
*
*/

void DeprecatedStartLog(
const std::string& full_file_path) {
std::cerr << "Not opening log file: " << full_file_path << std::endl;
}

void DeprecatedStartLog(
std::ostream* stream) {
*stream << "Deprecated Logging not implemented" << std::endl;
}

void DeprecatedStopLog() {}

0 comments on commit 87febb7

Please sign in to comment.