Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
ae4131cb
Commit
ae4131cb
authored
10 years ago
by
Vittorio Giovara
Committed by
Tristan Matthews
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
logger: remove (most) android hacks
Change-Id: Id4b1d6f43e18eb079752bbc5b79b922a711b51c2 Refs: #46972
parent
9936e2b5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
daemon/src/logger.c
+1
-0
1 addition, 0 deletions
daemon/src/logger.c
daemon/src/logger.h
+24
-20
24 additions, 20 deletions
daemon/src/logger.h
with
25 additions
and
20 deletions
daemon/src/logger.c
+
1
−
0
View file @
ae4131cb
...
...
@@ -31,6 +31,7 @@
#include
<stdio.h>
#include
<stdarg.h>
#include
<string.h>
#include
<errno.h>
#include
"logger.h"
...
...
This diff is collapsed.
Click to expand it.
daemon/src/logger.h
+
24
−
20
View file @
ae4131cb
...
...
@@ -38,12 +38,6 @@ extern "C" {
#include
<stdint.h>
#include
<pthread.h>
#ifdef __ANDROID__
#include
<android/log.h>
#else
#include
<syslog.h>
#endif
/**
* Print something, coloring it depending on the level
*/
...
...
@@ -73,16 +67,9 @@ void strErr();
(unsigned long) pthread_self() & 0xffff, \
##__VA_ARGS__
#ifndef __ANDROID__
#define FILE_NAME __FILE__
#define ERROR(M, ...) LOGGER(M, LOG_ERR, ##__VA_ARGS__)
#define WARN(M, ...) LOGGER(M, LOG_WARNING, ##__VA_ARGS__)
#define INFO(M, ...) LOGGER(M, LOG_INFO, ##__VA_ARGS__)
#define DEBUG(M, ...) LOGGER(M, LOG_DEBUG, ##__VA_ARGS__)
#define LOGGER(M, LEVEL, ...) logger(LEVEL, LOG_FORMAT(M, ##__VA_ARGS__))
#ifdef __ANDROID__
#
else
/* __ANDROID__ */
#
include
<android/log.h>
#ifndef APP_NAME
#define APP_NAME "libsflphone"
...
...
@@ -92,13 +79,30 @@ void strErr();
#define FILE_NAME (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 \
: __FILE__)
#define ERROR(M, ...) LOGGER(M, ANDROID_LOG_ERROR, ##__VA_ARGS__)
#define WARN(M, ...) LOGGER(M, ANDROID_LOG_WARN, ##__VA_ARGS__)
#define INFO(M, ...) LOGGER(M, ANDROID_LOG_INFO, ##__VA_ARGS__)
#define DEBUG(M, ...) LOGGER(M, ANDROID_LOG_DEBUG, ##__VA_ARGS__)
#define LOGGER(M, LEVEL, ...) __android_log_print(LEVEL, APP_NAME, LOG_FORMAT(M, ##__VA_ARGS__))
// because everyone likes reimplementing the wheel
#define LOG_ERR ANDROID_LOG_ERROR
#define LOG_WARNING ANDROID_LOG_WARN
#define LOG_INFO ANDROID_LOG_INFO
#define LOG_DEBUG ANDROID_LOG_DEBUG
#define LOGGER(M, LEVEL, ...) __android_log_print(LEVEL, APP_NAME, \
LOG_FORMAT(M, ##__VA_ARGS__))
#else
/* __ANDROID__ */
#include
<syslog.h>
#define FILE_NAME __FILE__
#define LOGGER(M, LEVEL, ...) logger(LEVEL, LOG_FORMAT(M, ##__VA_ARGS__))
#endif
/* __ANDROID__ */
#define ERROR(M, ...) LOGGER(M, LOG_ERR, ##__VA_ARGS__)
#define WARN(M, ...) LOGGER(M, LOG_WARNING, ##__VA_ARGS__)
#define INFO(M, ...) LOGGER(M, LOG_INFO, ##__VA_ARGS__)
#define DEBUG(M, ...) LOGGER(M, LOG_DEBUG, ##__VA_ARGS__)
#define BLACK "\033[22;30m"
#define RED "\033[22;31m"
#define GREEN "\033[22;32m"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment