Removed unnecessary methods from PLogger's bind class, and added properties.

This commit is contained in:
Relintai 2022-06-11 17:51:49 +02:00
parent b0ebe103f7
commit f3373e0fa4
2 changed files with 8 additions and 51 deletions

View File

@ -13,54 +13,18 @@ void _PLogger::set_backend(const Ref<LoggerBackend> &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;

View File

@ -17,24 +17,9 @@ public:
void set_backend(const Ref<LoggerBackend> &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();