diff options
author | Ruslan Mustakov <r.mustakov@gmail.com> | 2017-09-22 12:56:02 +0700 |
---|---|---|
committer | Ruslan Mustakov <r.mustakov@gmail.com> | 2017-09-25 16:19:21 +0700 |
commit | 1a2311e3505765e37b736fe6bb46bb229e00701f (patch) | |
tree | fd592573dbe7d95b89649eaa677bef54336c648e /platform/javascript/os_javascript.cpp | |
parent | 14b4ad931f54c73aff9021a1314943278295e602 (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 'platform/javascript/os_javascript.cpp')
-rw-r--r-- | platform/javascript/os_javascript.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index f103035b27..82a8409615 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -85,6 +85,10 @@ void OS_JavaScript::initialize_core() { FileAccess::make_default<FileAccessBufferedFA<FileAccessUnix> >(FileAccess::ACCESS_RESOURCES); } +void OS_JavaScript::initialize_logger() { + _set_logger(memnew(StdLogger)); +} + void OS_JavaScript::set_opengl_extensions(const char *p_gl_extensions) { ERR_FAIL_COND(!p_gl_extensions); |