Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nathan OBrian
Nebulo
Commits
9a1ea102
Commit
9a1ea102
authored
Jul 27, 2019
by
Daniel Wolf
Browse files
Added a preference for advanced logging, which logs messages from the vpn library with a FINE level
parent
5b4fe1fe
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/smokescreen/service/DnsVpnService.kt
View file @
9a1ea102
...
...
@@ -782,13 +782,14 @@ class DnsVpnService : VpnService(), Runnable {
log
(
"DnsProxy created, creating VPN proxy"
)
vpnProxy
=
VPNTunnelProxy
(
dnsProxy
!!
,
vpnService
=
this
,
coroutineScope
=
CoroutineScope
(
newFixedThreadPoolContext
(
2
,
"proxy-pool"
)),
logger
=
object
:
com
.
frostnerd
.
vpntunnelproxy
.
Logger
()
{
val
advancedLogging
=
getPreferences
().
advancedLogging
override
fun
logException
(
ex
:
Exception
,
terminal
:
Boolean
,
level
:
Level
)
{
if
(
terminal
)
log
(
ex
)
else
log
(
Logger
.
stacktraceToString
(
ex
),
"VPN-LIBRARY, $level"
)
}
override
fun
logMessage
(
message
:
String
,
level
:
Level
)
{
if
(
level
>=
Level
.
INFO
||
(
BuildConfig
.
DEBUG
&&
level
>=
Level
.
FINE
))
{
if
(
level
>=
Level
.
INFO
||
(
(
BuildConfig
.
DEBUG
||
advancedLogging
)
&&
level
>=
Level
.
FINE
))
{
log
(
message
,
"VPN-LIBRARY, $level"
)
}
}
...
...
app/src/main/java/com/frostnerd/smokescreen/util/preferences/AppSettings.kt
View file @
9a1ea102
...
...
@@ -193,6 +193,10 @@ class AppSettingsSharedPreferences(context: Context) : AppSettings, SimpleTypedP
"logging_enabled"
,
BuildConfig
.
VERSION_NAME
.
contains
(
"alpha"
,
true
)
||
BuildConfig
.
VERSION_NAME
.
contains
(
"beta"
,
true
)
)
var
advancedLogging
:
Boolean
by
booleanPref
(
"advanced_logging"
,
false
)
override
var
crashReportingEnabled
:
Boolean
by
booleanPref
(
"enable_sentry"
,
false
)
override
var
enableIpv6
:
Boolean
by
booleanPref
(
"ipv6_enabled"
,
true
)
...
...
app/src/main/res/values/strings-preference.xml
View file @
9a1ea102
...
...
@@ -71,6 +71,9 @@
<string
name=
"title_enable_logging"
>
Enable logging
</string>
<string
name=
"summary_enable_logging"
>
Enables logging of debug information (contains statistic data). These logs aren\'t send automatically.
</string>
<string
name=
"title_advanced_logging"
>
Advanced logging
</string>
<string
name=
"summary_advanced_logging"
>
Adds more logging, which could help with more persistent problems.
</string>
<string
name=
"title_send_logs"
>
Send logs
</string>
<string
name=
"summary_send_logs"
>
Click here to send the logs to the developer.
</string>
...
...
app/src/main/res/xml/preferences.xml
View file @
9a1ea102
...
...
@@ -131,6 +131,12 @@
android:summary=
"@string/summary_enable_logging"
android:key=
"logging_enabled"
/>
<CheckBoxPreference
android:title=
"@string/title_advanced_logging"
android:summary=
"@string/summary_advanced_logging"
android:dependency=
"logging_enabled"
android:key=
"advanced_logging"
/>
<Preference
android:key=
"send_logs"
android:title=
"@string/title_send_logs"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment