summaryrefslogtreecommitdiff
path: root/core/os
diff options
context:
space:
mode:
authorVoylin <0voylin0@gmail.com>2022-05-03 08:29:38 +0900
committerVoylin <0voylin0@gmail.com>2022-06-29 00:41:29 +0900
commitc6291bcd8a49055ce2158f88759a487de5b8d1bd (patch)
treef7fed88c41db90a5af0e1cf1165d1f0e1fbb1ea8 /core/os
parent622b656c40f9d8d9c8fdd45d6727f416952636d7 (diff)
Adding print_rich for printing with BBCode
Diffstat (limited to 'core/os')
-rw-r--r--core/os/os.cpp15
-rw-r--r--core/os/os.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp
index 93477f4288..b9daf6fa53 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -100,6 +100,21 @@ void OS::print(const char *p_format, ...) {
va_end(argp);
}
+void OS::print_rich(const char *p_format, ...) {
+ if (!_stdout_enabled) {
+ return;
+ }
+
+ va_list argp;
+ va_start(argp, p_format);
+
+ if (_logger) {
+ _logger->logv(p_format, argp, false);
+ }
+
+ va_end(argp);
+}
+
void OS::printerr(const char *p_format, ...) {
if (!_stderr_enabled) {
return;
diff --git a/core/os/os.h b/core/os/os.h
index c6ea9d869a..af6c38cbe0 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -120,6 +120,7 @@ public:
void print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, bool p_editor_notify = false, Logger::ErrorType p_type = Logger::ERR_ERROR);
void print(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3;
+ void print_rich(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3;
void printerr(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3;
virtual String get_stdin_string(bool p_block = true) = 0;