Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
enzevalos_iphone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
enzevalos
enzevalos_iphone
Commits
79f8e92f
Commit
79f8e92f
authored
5 years ago
by
Oliver Wiese
Browse files
Options
Downloads
Patches
Plain Diff
fix logging mail
parent
f31d9a45
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
enzevalos_iphone/Logger.swift
+4
-2
4 additions, 2 deletions
enzevalos_iphone/Logger.swift
with
4 additions
and
2 deletions
enzevalos_iphone/Logger.swift
+
4
−
2
View file @
79f8e92f
...
...
@@ -19,7 +19,8 @@ class Logger {
static
fileprivate
func
sendCheck
()
{
if
nextDeadline
<=
Date
()
&&
AppDelegate
.
getAppDelegate
()
.
currentReachabilityStatus
!=
.
notReachable
&&
UserManager
.
loadUserValue
(
Attribute
.
accountname
)
!=
nil
&&
UserDefaults
.
standard
.
bool
(
forKey
:
"launchedBefore"
){
let
deadlineIsNow
=
nextDeadline
<=
Date
()
if
deadlineIsNow
&&
AppDelegate
.
getAppDelegate
()
.
currentReachabilityStatus
!=
.
notReachable
&&
UserManager
.
loadUserValue
(
Attribute
.
accountname
)
!=
nil
&&
UserDefaults
.
standard
.
bool
(
forKey
:
"launchedBefore"
){
//Do not send duplicate mails
let
tmpNextDeadline
=
Date
(
timeIntervalSinceNow
:
TimeInterval
(
loggingInterval
))
nextDeadline
=
tmpNextDeadline
...
...
@@ -316,7 +317,8 @@ class Logger {
static
private
func
sendLog
(
logMailAddress
:
String
=
logReceiver
)
{
let
jsonEncoder
=
JSONEncoder
()
if
let
data
=
try
?
jsonEncoder
.
encode
(
Maildata
()),
let
text
=
String
(
data
:
data
,
encoding
:
.
utf8
),
text
.
count
>
0
{
AppDelegate
.
getAppDelegate
()
.
mailHandler
.
send
([
logMailAddress
],
ccEntrys
:
[],
bccEntrys
:
[],
subject
:
"[Enzevalos] Log"
,
message
:
text
,
callback
:
sendCallback
,
loggingMail
:
true
,
uiState
:
.
letter
)
let
mail
=
OutgoingMail
.
createLoggingMail
(
addr
:
logMailAddress
,
textcontent
:
text
)
mail
.
send
()
}
LogInUserDefaults
.
handler
.
reset
()
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment