Skip to content

Commit 1f3cbe6

Browse files
NathanWalkerammarahm-ed
authored andcommitted
chore: log disable part 1 - still get TNS.Java logs though
1 parent 2ef1961 commit 1f3cbe6

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

test-app/app/src/main/java/com/tns/LogcatLogger.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ public final void write(String tag, String msg) {
3333
}
3434

3535
private void initLogging(Context context) {
36-
setEnabled(true);
37-
// boolean isDebuggableApp = Util.isDebuggableApp(context);
38-
// if (isDebuggableApp) {
39-
// String verboseLoggingProp = Util.readSystemProperty("nativescript.verbose.logging");
40-
//
41-
// if (Util.isPositive(verboseLoggingProp)) {
42-
// setEnabled(true);
43-
// }
44-
// }
36+
// setEnabled(true);
37+
boolean isDebuggableApp = Util.isDebuggableApp(context);
38+
if (isDebuggableApp) {
39+
String verboseLoggingProp = Util.readSystemProperty("nativescript.verbose.logging");
40+
41+
if (Util.isPositive(verboseLoggingProp)) {
42+
setEnabled(true);
43+
}
44+
}
4545
}
4646
}

test-app/runtime/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
apply plugin: 'com.android.library'
22

3+
// can be: "V8", "JSC", "HERMES", "QUICKJS"
34
def jsEngine = "V8"
45
if (project.hasProperty("engine")) {
56
jsEngine = engine;

test-app/runtime/src/main/cpp/runtime/Runtime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
using namespace tns;
3939
using namespace std;
4040

41-
bool tns::LogEnabled = true;
41+
bool tns::LogEnabled = false;
4242

4343
void Runtime::Init(JavaVM *vm) {
4444
__android_log_print(ANDROID_LOG_INFO, "TNS.Runtime",

test-app/runtime/src/main/cpp/runtime/exceptions/NativeScriptAssert.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ bool enabled = false;
1515
namespace tns {
1616
extern bool LogEnabled;
1717

18-
// #define DEBUG_WRITE(fmt, args...) if (enabled) __android_log_print(ANDROID_LOG_DEBUG, "TNS.Native", fmt, ##args)
19-
#define DEBUG_WRITE(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, "TNS.Native", fmt, ##args)
20-
#define DEBUG_WRITE_FORCE(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, "TNS.Native", fmt, ##args)
21-
#define DEBUG_WRITE_FATAL(fmt, args...) __android_log_print(ANDROID_LOG_FATAL, "TNS.Native", fmt, ##args)
18+
#define DEBUG_WRITE(fmt, args...) if (enabled) __android_log_print(ANDROID_LOG_DEBUG, "TNS.Native", fmt, ##args)
19+
// #define DEBUG_WRITE(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, "TNS.Native", fmt, ##args)
20+
#define DEBUG_WRITE_FORCE(fmt, args...) if (enabled) __android_log_print(ANDROID_LOG_DEBUG, "TNS.Native", fmt, ##args)
21+
#define DEBUG_WRITE_FATAL(fmt, args...) if (enabled) __android_log_print(ANDROID_LOG_FATAL, "TNS.Native", fmt, ##args)
2222
}
2323

2424
#endif /* NATIVESCRIPTASSERT_H_ */

0 commit comments

Comments
 (0)