diff options
author | Andreas Haas <Hinsbart@users.noreply.github.com> | 2017-10-02 23:51:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-02 23:51:26 +0200 |
commit | 132ba0ed9799db9ed1449fa2f2fc597d4b91612d (patch) | |
tree | b0c62cdc864e64636fa6717438025fbd9a35fb04 /platform/iphone | |
parent | de9cc6ed96c79c70ca9cf22830b3e42cca4f244b (diff) | |
parent | 1a2311e3505765e37b736fe6bb46bb229e00701f (diff) |
Merge pull request #11568 from endragor/loggers
Extract logging logic
Diffstat (limited to 'platform/iphone')
-rw-r--r-- | platform/iphone/os_iphone.cpp | 10 | ||||
-rw-r--r-- | platform/iphone/os_iphone.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index 086cbe5010..5009f7d8ae 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -41,6 +41,7 @@ #include "core/os/dir_access.h" #include "core/os/file_access.h" #include "core/project_settings.h" +#include "drivers/unix/syslog_logger.h" #include "sem_iphone.h" @@ -98,6 +99,13 @@ void OSIPhone::initialize_core() { SemaphoreIphone::make_default(); }; +void OSIPhone::initialize_logger() { + Vector<Logger *> loggers; + loggers.push_back(memnew(SyslogLogger)); + loggers.push_back(memnew(RotatedFileLogger("user://logs/log.txt"))); + _set_logger(memnew(CompositeLogger(loggers))); +} + void OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) { supported_orientations = 0; @@ -568,6 +576,8 @@ OSIPhone::OSIPhone(int width, int height) { vm.resizable = false; set_video_mode(vm); event_count = 0; + + _set_logger(memnew(SyslogLogger)); }; OSIPhone::~OSIPhone() { diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h index 3ebd5a74db..11f4eed5e7 100644 --- a/platform/iphone/os_iphone.h +++ b/platform/iphone/os_iphone.h @@ -90,6 +90,7 @@ private: virtual VideoMode get_default_video_mode() const; + virtual void initialize_logger(); virtual void initialize_core(); virtual void initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver); |