-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add server side logging configurations #358
add server side logging configurations #358
Conversation
…-set-log-level-in-sdk-in-initialize
832f6d8
to
e95bf77
Compare
e95bf77
to
b23cdce
Compare
e119e90
to
4e006fe
Compare
… of github.com:radarlabs/radar-sdk-android into shicheng/fence-1948-set-log-level-in-sdk-in-initialize
I will remove the publish keys for testing if everything else looks good |
@@ -130,6 +131,8 @@ internal class RadarApiClient( | |||
if (usage != null) { | |||
queryParams.append("&usage=${usage}") | |||
} | |||
val clientSdkConfiguration = RadarSettings.getClientSdkConfiguration(context).toString() | |||
queryParams.append("&clientSdkConfiguration=${URLEncoder.encode(clientSdkConfiguration, "utf-8")}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to confirm this is consistent with the iOS encoding?
Also a GET request can technically have a body, would we want to utilize that here?
internal fun getLogLevel(context: Context): Radar.RadarLogLevel { | ||
val logLevelInt = getSharedPreferences(context).getInt(KEY_LOG_LEVEL, 3) | ||
val userDebug = getUserDebug(context) | ||
return if (userDebug) Radar.RadarLogLevel.DEBUG else Radar.RadarLogLevel.fromInt(logLevelInt) | ||
} | ||
|
||
internal fun setLogLevel(context: Context, level: Radar.RadarLogLevel) { | ||
val logLevelInt = level.value | ||
getSharedPreferences(context).edit { putInt(KEY_LOG_LEVEL, logLevelInt) } | ||
val sdkConfiguration = getClientSdkConfiguration(context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echoing my sentiments from the ios PR, maybe move the syncing logic to the logger obj?
fun setSdkConfiguration(context: Context, configuration: RadarSdkConfiguration?) { | ||
Radar.logger.d("set SDK Configuration | sdkConfiguration = $configuration") | ||
if (configuration != null) { | ||
getSharedPreferences(context).edit { putInt(KEY_LOG_LEVEL, configuration.logLevel.value) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to store the entire object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed for logLevel, added in the next PR
android waypoint build:
https://expo.dev/accounts/radarlabs/projects/waypoint/builds/9adf68f2-2e37-4c40-844c-6389f63bed62
see #371