Skip to content

Commit

Permalink
feat: Add common hideLogs option (#2865)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored May 4, 2020
1 parent d60757a commit 1b3f0ec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ public static void error(String tag, String message, Throwable e) {
}

protected static boolean shouldLog() {
return !Config.getBoolean("android.hideLogs", false);
return !Config.getBoolean("android.hideLogs", Config.getBoolean("hideLogs", false));
}
}
2 changes: 1 addition & 1 deletion ios/Capacitor/Capacitor/CAPLog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class CAPLog {
}

public static func hideLogs() -> Bool {
if let hideLogs = config.getValue("ios.hideLogs") as? Bool {
if let hideLogs = (config.getValue("ios.hideLogs") as? Bool) ?? (config.getValue("hideLogs") as? Bool) {
return hideLogs
}
return false
Expand Down
13 changes: 11 additions & 2 deletions site/docs-md/basics/configuring-your-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ The current ones you might configure are:
// Android Studio install path, but you may change it manually.
"windowsAndroidStudioPath": "C:\Program Files\Android\Android Studio\bin\studio64.exe",

// A Boolean value that determines whether to hide native logs for iOS and Android. The preference is ignored if it's also declared inside ios or android
// Default is false
"hideLogs": true

// Server object contains port and url configurations
"server": {
// You can make the app to load an external url (i.e. to live reload)
Expand Down Expand Up @@ -101,7 +105,11 @@ The current ones you might configure are:
// any WebViews of this application.
// This flag can be enabled in order to facilitate debugging of web layouts
// and JavaScript code running inside WebViews.
"webContentsDebuggingEnabled": true
"webContentsDebuggingEnabled": true,

// A Boolean value that determines whether to hide native Android logs or not
// Default is false
"hideLogs": true
},
"ios": {
// User agent of Capacitor WebView for iOS
Expand All @@ -126,7 +134,8 @@ The current ones you might configure are:
// A Boolean value that determines whether pressing on a link displays a preview of
// the destination for the link.
"allowsLinkPreview": false,
// A Boolean value that determines whether to hide native logs or not

// A Boolean value that determines whether to hide native iOS logs or not
// Default is false
"hideLogs": true
},
Expand Down

0 comments on commit 1b3f0ec

Please sign in to comment.