Skip to content
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

Support rolling log files #110

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
18 changes: 18 additions & 0 deletions Sources/Log.swift
Original file line number Diff line number Diff line change
@@ -233,6 +233,24 @@ public struct Log
}
logLock.unlock()
}

/// Experimental - Try to use in case you need to disable logger to change the configuration and restart.
public static func disable()
{
logLock.lock()

if didEnable
{
self.error = nil
self.warning = nil
self.info = nil
self.debug = nil
self.verbose = nil
didEnable = false
}

logLock.unlock()
}

private static let logLock = NSLock()
private static var didEnable = false