summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium42 <rubidium@openttd.org>2021-06-12 20:45:11 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-06-13 15:25:31 +0200
commit121b037054d2a6d354f28e9789c390145d7cd1f9 (patch)
treeed9a6238c73c980d6d7a1dfb734bdbc69147be70
parent6b757c716a736b2f0b91ede0e0e397be6ad03a27 (diff)
downloadopenttd-121b037054d2a6d354f28e9789c390145d7cd1f9.tar.xz
Codechange: remove single use IConsoleDebug
-rw-r--r--src/console.cpp14
-rw-r--r--src/console_func.h1
-rw-r--r--src/debug.cpp3
3 files changed, 2 insertions, 16 deletions
diff --git a/src/console.cpp b/src/console.cpp
index 6389aef6c..11a3d4771 100644
--- a/src/console.cpp
+++ b/src/console.cpp
@@ -145,20 +145,6 @@ void CDECL IConsolePrintF(TextColour colour_code, const char *format, ...)
}
/**
- * It is possible to print debugging information to the console,
- * which is achieved by using this function. Can only be used by
- * debug() in debug.cpp. You need at least a level 2 (developer) for debugging
- * messages to show up
- * @param dbg debugging category
- * @param string debugging message
- */
-void IConsoleDebug(const char *dbg, const char *string)
-{
- if (_settings_client.gui.developer <= 1) return;
- IConsolePrintF(CC_DEBUG, "dbg: [%s] %s", dbg, string);
-}
-
-/**
* It is possible to print warnings to the console. These are mostly
* errors or mishaps, but non-fatal. You need at least a level 1 (developer) for
* debugging messages to show up
diff --git a/src/console_func.h b/src/console_func.h
index 8b38d2dae..b0ffbb9dd 100644
--- a/src/console_func.h
+++ b/src/console_func.h
@@ -47,7 +47,6 @@ static inline void IConsolePrint(TextColour colour_code, const T &format, A firs
}
void CDECL IConsolePrintF(TextColour colour_code, const char *format, ...) WARN_FORMAT(2, 3);
-void IConsoleDebug(const char *dbg, const char *string);
void IConsoleWarning(const char *string);
void IConsoleError(const char *string);
diff --git a/src/debug.cpp b/src/debug.cpp
index 32095e0f8..418598d5d 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -135,8 +135,9 @@ void DebugPrint(const char *level, const std::string &message)
#else
fputs(msg.c_str(), stderr);
#endif
+
NetworkAdminConsole(level, message);
- IConsoleDebug(level, message.c_str());
+ if (_settings_client.gui.developer >= 2) IConsolePrint(CC_DEBUG, "dbg: [{}] {}", level, message);
}
}