The Type Definition for the Log Level in the AppCenter package seems wrong.
If we follow the AppCenter type definition we should use the AppCenterLogLevel enum in this way:
import AppCenter from 'appcenter';
AppCenter.setLogLevel(AppCenter.AppCenterLogLevel.DEBUG);
But in reality the AppCenterLogLevel in undefined because is not defined in the AppCenter.js, so we should use LogLevelXXX instead:
import AppCenter from 'appcenter';
AppCenter.setLogLevel(AppCenter.LogLevelDebug);
But this will rise a type error since Property 'LogLevelDebug' does not exist on type AppCenter.
I think a possible solution could be export all the log level of the appcenter-log.js as a constant in the AppCenter.d.ts type definition file instead of a enum, something like this:
/**
* Debug information will be logged
*/
export const LogLevelDebug = 3;
AppCenter Package Version:
โโ [email protected]
โ โโ [email protected]
โโ [email protected]
โ โโ [email protected]
โโ [email protected]
โโ [email protected]
โ โโ [email protected]
React Native Environment Info:
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 546.52 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.5.0 - /usr/local/bin/node
Yarn: 1.3.2 - ~/.npm-global/bin/yarn
npm: 6.1.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
Build Tools: 23.0.1, 23.0.2, 23.0.3, 25.0.0, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.1, 27.0.3, 28.0.3
API Levels: 23, 24, 25, 26, 27, 28
IDEs:
Android Studio: 3.1 AI-173.4907809
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
@types/react: 16.7.7 => 16.7.7
@types/react-native: 0.57.13 => 0.57.13
react: 16.6.1 => 16.6.1
react-native: 0.57.5 => 0.57.5
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
Hi @thomasgazzoni, thanks a lot for reporting this, it's indeed a bug. It is being tracked and we'll get to it as soon as we can.
Hi @thomasgazzoni, sorry about the confusion, this isn't actually a bug. This is the correct usage for Typescript:
AppCenter.setLogLevel(AppCenter.AppCenterLogLevel.DEBUG);
We don't have Typescript documentation explicitly. AppCenter.setLogLevel(AppCenter.LogLevelDebug); is used in Javascript only.
@thomasgazzoni We will deprecate the redundant AppCenter.AppCenterLogLevel.* log levels in favor of the shorter AppCenter.LogLevel.* based on your feedback
@jwallra Thank you! Looking forward for the next v1.10.1 version to have a try and close this issue.
Released in 1.11.0.