diff --git a/core/bind/logger_bind.cpp b/core/bind/logger_bind.cpp index a2e4e7643..301c9d8bf 100644 --- a/core/bind/logger_bind.cpp +++ b/core/bind/logger_bind.cpp @@ -13,54 +13,18 @@ void _PLogger::set_backend(const Ref &backend) { void _PLogger::log_trace(const String &str) { PLogger::log_trace(str); } -void _PLogger::log_trace(const char *str) { - PLogger::log_trace(str); -} -void _PLogger::log_trace(const char *p_function, const char *p_file, int p_line, const char *str) { - PLogger::log_trace(p_function, p_file, p_line, str); -} -void _PLogger::log_trace(const char *p_function, const char *p_file, int p_line, const String &str) { - PLogger::log_trace(p_function, p_file, p_line, str); -} void _PLogger::log_message(const String &str) { PLogger::log_message(str); } -void _PLogger::log_message(const char *str) { - PLogger::log_message(str); -} -void _PLogger::log_message(const char *p_function, const char *p_file, int p_line, const char *str) { - PLogger::log_message(p_function, p_file, p_line, str); -} -void _PLogger::log_message(const char *p_function, const char *p_file, int p_line, const String &str) { - PLogger::log_message(p_function, p_file, p_line, str); -} void _PLogger::log_warning(const String &str) { PLogger::log_warning(str); } -void _PLogger::log_warning(const char *str) { - PLogger::log_warning(str); -} -void _PLogger::log_warning(const char *p_function, const char *p_file, int p_line, const char *str) { - PLogger::log_warning(p_function, p_file, p_line, str); -} -void _PLogger::log_warning(const char *p_function, const char *p_file, int p_line, const String &str) { - PLogger::log_warning(p_function, p_file, p_line, str); -} void _PLogger::log_error(const String &str) { PLogger::log_error(str); } -void _PLogger::log_error(const char *str) { - PLogger::log_error(str); -} -void _PLogger::log_error(const char *p_function, const char *p_file, int p_line, const char *str) { - PLogger::log_error(p_function, p_file, p_line, str); -} -void _PLogger::log_error(const char *p_function, const char *p_file, int p_line, const String &str) { - PLogger::log_error(p_function, p_file, p_line, str); -} _PLogger *_PLogger::get_singleton() { return _self; @@ -74,6 +38,14 @@ _PLogger::~_PLogger() { } void _PLogger::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_backend"), &_PLogger::get_backend); + ClassDB::bind_method(D_METHOD("set_backend", "backend"), &_PLogger::set_backend); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "backend", PROPERTY_HINT_RESOURCE_TYPE, "LoggerBackend"), "set_backend", "get_backend"); + + ClassDB::bind_method(D_METHOD("log_trace", "str"), &_PLogger::log_trace); + ClassDB::bind_method(D_METHOD("log_message", "str"), &_PLogger::log_message); + ClassDB::bind_method(D_METHOD("log_warning", "str"), &_PLogger::log_warning); + ClassDB::bind_method(D_METHOD("log_error", "str"), &_PLogger::log_error); } _PLogger *_PLogger::_self = nullptr; diff --git a/core/bind/logger_bind.h b/core/bind/logger_bind.h index a1f3ecf97..0a00c36fc 100644 --- a/core/bind/logger_bind.h +++ b/core/bind/logger_bind.h @@ -17,24 +17,9 @@ public: void set_backend(const Ref &backend); void log_trace(const String &str); - void log_trace(const char *str); - void log_trace(const char *p_function, const char *p_file, int p_line, const String &str); - void log_trace(const char *p_function, const char *p_file, int p_line, const char *str); - void log_message(const String &str); - void log_message(const char *str); - void log_message(const char *p_function, const char *p_file, int p_line, const String &str); - void log_message(const char *p_function, const char *p_file, int p_line, const char *str); - void log_warning(const String &str); - void log_warning(const char *str); - void log_warning(const char *p_function, const char *p_file, int p_line, const String &str); - void log_warning(const char *p_function, const char *p_file, int p_line, const char *str); - void log_error(const String &str); - void log_error(const char *str); - void log_error(const char *p_function, const char *p_file, int p_line, const char *str); - void log_error(const char *p_function, const char *p_file, int p_line, const String &str); static _PLogger *get_singleton();