summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorRuslan Mustakov <r.mustakov@gmail.com>2017-09-22 12:56:02 +0700
committerRuslan Mustakov <r.mustakov@gmail.com>2017-09-25 16:19:21 +0700
commit1a2311e3505765e37b736fe6bb46bb229e00701f (patch)
treefd592573dbe7d95b89649eaa677bef54336c648e /main
parent14b4ad931f54c73aff9021a1314943278295e602 (diff)
Extract logging logic
Previously logging logic was scattered over OS class implementations with plenty of duplication. Major changes in this commit: - Extracted logging logic into a separate Logger hierarchy. It allows easy configuration of logging mechanism depending on compile-time or run-time configuration. - Implemented RotatedFileLogger which is usually used with StdLogger, providing persistency of logs. It is often important to be able to obtain logs of the game even in production to be able to understand what happened prior to some problem. On mobile there previously was no way to obtain the logs aside from having the device connected to your machine. - flush() is not performed in release mode for every logged line. It is only performed for errors.
Diffstat (limited to 'main')
-rw-r--r--main/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 9096b935c2..9ae6d3e92c 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -231,7 +231,6 @@ void Main::print_help(const char *p_binary) {
}
Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_phase) {
-
RID_OwnerBase::init_rid();
OS::get_singleton()->initialize_core();
@@ -254,6 +253,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
register_core_settings(); //here globals is present
+ OS::get_singleton()->initialize_logger();
+
translation_server = memnew(TranslationServer);
performance = memnew(Performance);
globals->add_singleton(ProjectSettings::Singleton("Performance", performance));