Skip to content

Commit

Permalink
fix: don't log if .ekenablelogging doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
dhinakg committed Jan 23, 2024
1 parent ff20e10 commit 7fd49cf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions logger/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ struct TextLog: TextOutputStream {
}

func write(_ string: String) {
guard enableLogging else { return }
#if os(iOS)
let log = NSURL.fileURL(withPath: ("/var/jb/var/mobile/log.txt" as NSString).resolvingSymlinksInPath)
#else
Expand Down

3 comments on commit 7fd49cf

@jkhsjdhjs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for this fix! I noticed the file recently and it's already 2GB in size for me. A lot of users may not even be aware of this file that is taking up a lot of space, so would it be possible to remove this log file automatically with the next release? Or alternatively advise the users somehow to remove this file manually?

@dhinakg
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5f344d9 should take care of it

@jkhsjdhjs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Please sign in to comment.