diff options
author | Max Kellermann <max@duempel.org> | 2014-02-21 22:52:19 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-22 00:18:46 +0100 |
commit | 90114514a9d9439f7ed9519f2956bb00942771c5 (patch) | |
tree | a20e96f56ceb07c6426c147df40ec04b988d69c8 /src/LogInit.cxx | |
parent | 7757e59e7874ed160702483bbbd62c518e8195eb (diff) |
LogBackend: use __android_log_print() on Android
Diffstat (limited to 'src/LogInit.cxx')
-rw-r--r-- | src/LogInit.cxx | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/LogInit.cxx b/src/LogInit.cxx index 38dd5356b..c80d4575f 100644 --- a/src/LogInit.cxx +++ b/src/LogInit.cxx @@ -49,6 +49,8 @@ static constexpr Domain log_domain("log"); +#ifndef ANDROID + static int out_fd; static AllocatedPath out_path = AllocatedPath::Null(); @@ -101,16 +103,29 @@ parse_log_level(const char *value, unsigned line) } } +#endif + void log_early_init(bool verbose) { +#ifdef ANDROID + (void)verbose; +#else if (verbose) SetLogThreshold(LogLevel::DEBUG); +#endif } bool log_init(bool verbose, bool use_stdout, Error &error) { +#ifdef ANDROID + (void)verbose; + (void)use_stdout; + (void)error; + + return true; +#else const struct config_param *param; #ifdef HAVE_GLIB @@ -151,8 +166,11 @@ log_init(bool verbose, bool use_stdout, Error &error) log_init_file(param->line, error); } } +#endif } +#ifndef ANDROID + static void close_log_files(void) { @@ -161,16 +179,22 @@ close_log_files(void) #endif } +#endif + void log_deinit(void) { +#ifndef ANDROID close_log_files(); out_path = AllocatedPath::Null(); +#endif } - void setup_log_output(bool use_stdout) { +#ifdef ANDROID + (void)use_stdout; +#else if (use_stdout) return; @@ -193,10 +217,14 @@ void setup_log_output(bool use_stdout) #ifdef HAVE_GLIB SetLogCharset(nullptr); #endif +#endif } int cycle_log_files(void) { +#ifdef ANDROID + return 0; +#else int fd; if (out_path.IsNull()) @@ -217,4 +245,5 @@ int cycle_log_files(void) redirect_logs(fd); FormatDebug(log_domain, "Done cycling log files"); return 0; +#endif } |