diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2018-05-02 11:25:20 +0200 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2018-05-02 11:25:20 +0200 |
commit | 0bd4cd398b19c2ef90e2f39b40a60b9fa915d2b2 (patch) | |
tree | 743f64037eafbe47552dc136af551a59b34d1604 /src/logging.cpp | |
parent | 76f344de6d144e0a8169594836575a5812157327 (diff) |
logging: remove unused return value from LogPrintStr
`LogPrintStr` returns the number of characters printed. This number is
doubled if both logging to console and logging to file is enabled. As
the return value is never used, I've opted to remove it instead of try
to fix it.
Credit: @laanwj
Diffstat (limited to 'src/logging.cpp')
-rw-r--r-- | src/logging.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/logging.cpp b/src/logging.cpp index 6046969375..60d418fdb5 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -198,15 +198,13 @@ std::string BCLog::Logger::LogTimestampStr(const std::string &str) return strStamped; } -int BCLog::Logger::LogPrintStr(const std::string &str) +void BCLog::Logger::LogPrintStr(const std::string &str) { - int ret = 0; // Returns total number of characters written - std::string strTimestamped = LogTimestampStr(str); if (m_print_to_console) { // print to console - ret = fwrite(strTimestamped.data(), 1, strTimestamped.size(), stdout); + fwrite(strTimestamped.data(), 1, strTimestamped.size(), stdout); fflush(stdout); } if (m_print_to_file) { @@ -214,7 +212,6 @@ int BCLog::Logger::LogPrintStr(const std::string &str) // buffer if we haven't opened the log yet if (m_fileout == nullptr) { - ret = strTimestamped.length(); m_msgs_before_open.push_back(strTimestamped); } else @@ -224,15 +221,14 @@ int BCLog::Logger::LogPrintStr(const std::string &str) m_reopen_file = false; m_fileout = fsbridge::freopen(m_file_path, "a", m_fileout); if (!m_fileout) { - return ret; + return; } setbuf(m_fileout, nullptr); // unbuffered } - ret = FileWriteStr(strTimestamped, m_fileout); + FileWriteStr(strTimestamped, m_fileout); } } - return ret; } void BCLog::Logger::ShrinkDebugFile() |