From 897cf59085728207942cf57c71f6020780b0fdf2 Mon Sep 17 00:00:00 2001 From: Ian Keith Date: Thu, 1 Apr 2021 15:19:07 -0400 Subject: [PATCH 1/4] Updating to reflect logging changes. --- pages/docs/apis/console/index.md | 2 +- pages/docs/config/index.md | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pages/docs/apis/console/index.md b/pages/docs/apis/console/index.md index 040531d3..948e51f2 100644 --- a/pages/docs/apis/console/index.md +++ b/pages/docs/apis/console/index.md @@ -13,7 +13,7 @@ contributors: The Console API automatically sends `console.debug`, `console.error`, `console.info`, `console.log`, `console.trace` and `console.warn` calls to the native log system on each respective platform. This enables, for example, `console.log` calls to be rendered in the Xcode and Android Studio log windows. -It can be disabled by using `hideLogs` entry in `capacitor.config.json`, check [common configuration](/docs/basics/configuring-your-app#common-configuration) for more information. +The output of these calls can be controlled with the `loggingBehavior` entry in `capacitor.config.json`. Check [common configuration](/docs/basics/configuring-your-app#common-configuration) for more information. ## Example diff --git a/pages/docs/config/index.md b/pages/docs/config/index.md index bd3e0475..04d15f5a 100644 --- a/pages/docs/config/index.md +++ b/pages/docs/config/index.md @@ -40,9 +40,12 @@ Here is a full example of available configuration options for `capacitor.config. // Android Studio install path, but you may change it manually. windowsAndroidStudioPath: 'C:Program FilesAndroidAndroid Studio\binstudio64.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, + // The build configuration under which Capacitor will output log statements + // 'none' = logs are never produced + // 'debug' = logs are produced in debug builds but not production builds + // 'production' = logs are always produced + // Default is debug + loggingBehavior: 'debug', // Server object contains port and url configurations server: { From 800a7180e269592e7d68ce5ada248e2c8dbca036 Mon Sep 17 00:00:00 2001 From: Ian Keith Date: Tue, 6 Apr 2021 18:05:11 -0400 Subject: [PATCH 2/4] Updating v3 document. --- pages/docs/v3/config/index.md | 37 ++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/pages/docs/v3/config/index.md b/pages/docs/v3/config/index.md index e6563062..f7210c64 100644 --- a/pages/docs/v3/config/index.md +++ b/pages/docs/v3/config/index.md @@ -75,12 +75,21 @@ export interface CapacitorConfig { bundledWebRuntime?: boolean; /** - * Hide or show the native logs for iOS and Android. + * The build configuration (as defined by the native app) under which Capacitor + * will send statements to the log system. This applies to log statements in + * native code as well as statements redirected from JavaScript (`console.debug`, + * `console.error`, etc.). Enabling logging will let statements render in the + * Xcode and Android Studio windows but can leak information on device if enabled + * in released builds. * - * @since 2.1.0 - * @default false + * 'none' = logs are never produced + * 'debug' = logs are produced in debug builds but not production builds + * 'production' = logs are always produced + * + * @since 3.0.0 + * @default debug */ - hideLogs?: boolean; + loggingBehavior?: 'none' | 'debug' | 'production'; /** * User agent of Capacitor Web View. @@ -180,14 +189,14 @@ export interface CapacitorConfig { webContentsDebuggingEnabled?: boolean; /** - * Hide or show the native logs for Android. + * The build configuration under which Capacitor will generate logs. * - * Overrides global `hideLogs` option. + * Overrides global `loggingBehavior` option. * - * @since 2.1.0 - * @default false + * @since 3.0.0 + * @default debug */ - hideLogs?: boolean; + loggingBehavior?: 'none' | 'debug' | 'production'; /** * Allowlist of plugins to include during `npx cap sync` for Android. @@ -298,14 +307,14 @@ export interface CapacitorConfig { allowsLinkPreview?: boolean; /** - * Hide or show the native logs for iOS. + * The build configuration under which Capacitor will generate logs. * - * Overrides global `hideLogs` option. + * Overrides global `loggingBehavior` option. * - * @since 1.1.0 - * @default false + * @since 3.0.0 + * @default debug */ - hideLogs?: boolean; + loggingBehavior?: 'none' | 'debug' | 'production'; /** * Allowlist of plugins to include during `npx cap sync` for iOS. From 0335ae7d2ea672ed07fe2785b58217e3ae03ecea Mon Sep 17 00:00:00 2001 From: Ian Keith Date: Tue, 6 Apr 2021 18:05:41 -0400 Subject: [PATCH 3/4] Reverting v2 documentation changes This reverts commit 897cf59085728207942cf57c71f6020780b0fdf2. --- pages/docs/apis/console/index.md | 2 +- pages/docs/config/index.md | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pages/docs/apis/console/index.md b/pages/docs/apis/console/index.md index 948e51f2..040531d3 100644 --- a/pages/docs/apis/console/index.md +++ b/pages/docs/apis/console/index.md @@ -13,7 +13,7 @@ contributors: The Console API automatically sends `console.debug`, `console.error`, `console.info`, `console.log`, `console.trace` and `console.warn` calls to the native log system on each respective platform. This enables, for example, `console.log` calls to be rendered in the Xcode and Android Studio log windows. -The output of these calls can be controlled with the `loggingBehavior` entry in `capacitor.config.json`. Check [common configuration](/docs/basics/configuring-your-app#common-configuration) for more information. +It can be disabled by using `hideLogs` entry in `capacitor.config.json`, check [common configuration](/docs/basics/configuring-your-app#common-configuration) for more information. ## Example diff --git a/pages/docs/config/index.md b/pages/docs/config/index.md index 04d15f5a..bd3e0475 100644 --- a/pages/docs/config/index.md +++ b/pages/docs/config/index.md @@ -40,12 +40,9 @@ Here is a full example of available configuration options for `capacitor.config. // Android Studio install path, but you may change it manually. windowsAndroidStudioPath: 'C:Program FilesAndroidAndroid Studio\binstudio64.exe', - // The build configuration under which Capacitor will output log statements - // 'none' = logs are never produced - // 'debug' = logs are produced in debug builds but not production builds - // 'production' = logs are always produced - // Default is debug - loggingBehavior: 'debug', + // 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: { From 0febb7eb29cbcac4269472600e8d92175ed2b1e8 Mon Sep 17 00:00:00 2001 From: Ian Keith Date: Fri, 7 May 2021 18:11:39 -0400 Subject: [PATCH 4/4] Updating upgrade guide. --- pages/docs/v3/updating/3-0.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pages/docs/v3/updating/3-0.md b/pages/docs/v3/updating/3-0.md index 19554f55..a9de5f97 100644 --- a/pages/docs/v3/updating/3-0.md +++ b/pages/docs/v3/updating/3-0.md @@ -125,6 +125,10 @@ While many of the plugin APIs remain the same to ease the migration process to C - **Filesystem** - `stat()` method now returns ctime and mtime timestamps in milliseconds on all platforms. Previously, iOS returned timestamps in seconds. +## Logging Changes + +The `hideLogs` configuration option has been deprecated in Capacitor 3. It has been replaced by a new `loggingBehavior` configuration option. Details can be found [in the config documentation.](docs/config) + ## iOS Capacitor 3 supports iOS 12+. Xcode 12+ is required. CocoaPods 1.8+ is recommended.