Skip to content

Commit 0d43196

Browse files
Googlera-maurice
authored andcommitted
Customize the kDefaultTag in logging
This allows us to pass customized tag into logcat PiperOrigin-RevId: 242067773
1 parent 82f7be0 commit 0d43196

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

app/src/log_android.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,23 @@
2020
#include <android/log.h>
2121
#endif // !defined(FIREBASE_ANDROID_FOR_DESKTOP)
2222

23+
#if !defined(FIREBASE_NAMESPACE)
24+
#define FIREBASE_NAMESPACE firebase
25+
#endif
26+
27+
#define STR_EXPAND(x) #x
28+
#define STR(x) STR_EXPAND(x)
29+
2330
#include <assert.h>
2431
#include <jni.h>
2532
#include <stdarg.h>
2633
#include <stdio.h>
2734

2835
#include "app/src/util_android.h"
2936

30-
#if !defined(FIREBASE_NAMESPACE)
31-
#define FIREBASE_NAMESPACE firebase
32-
#endif
33-
3437
namespace FIREBASE_NAMESPACE {
3538

36-
const char* kDefaultTag = "firebase";
39+
const char* kDefaultTag = STR(FIREBASE_NAMESPACE);
3740

3841
// TODO(zxu): Instead of linking on log_stdio, mock the __android_log_vprint
3942
// and use the logic here.

0 commit comments

Comments
 (0)