@@ -16,7 +16,7 @@ public extension Stuff {
1616 /**
1717 Enumeration of the log levels
1818 */
19- public enum logLevel : Int {
19+ enum logLevel : Int {
2020 // Make sure all log events goes to the device log
2121 case productionLogAll = 0
2222 // Informational loging, lowest level
@@ -56,12 +56,12 @@ public extension Stuff {
5656 /**
5757 Set the minimum log level. By default set to .info which is the minimum. Everything will be loged.
5858 */
59- public static var minimumLogLevel : logLevel = . info
59+ static var minimumLogLevel : logLevel = . info
6060
6161 /**
6262 The print command for writing to the output window
6363 */
64- public static func print< T> ( _ object: T , _ level: logLevel = ( T . self is Error . Type ? . error : . debug) , filename: String = #file, line: Int = #line, funcname: String = #function, trace: [ String ] = Thread . callStackSymbols) {
64+ static func print< T> ( _ object: T , _ level: logLevel = ( T . self is Error . Type ? . error : . debug) , filename: String = #file, line: Int = #line, funcname: String = #function, trace: [ String ] = Thread . callStackSymbols) {
6565 if level. rawValue >= Stuff . minimumLogLevel. rawValue {
6666 let dateFormatter = DateFormatter ( )
6767 dateFormatter. dateFormat = " MM/dd/yyyy HH:mm:ss:SSS "
@@ -70,9 +70,9 @@ public extension Stuff {
7070 let file = URL ( string: filename) ? . lastPathComponent ?? " "
7171 let traceOutput : String = trace. map { " \t \t \( $0) " } . reduce ( " \n " ) { " \( $0) \n \( $1) " }
7272 let output : String = object is Error ? " \( ( object as! Error ) . localizedDescription) \( traceOutput) " : " \( object) "
73- var logText = " \n \( level. description ( ) ) . \( level) ⏱ \( dateFormatter. string ( from: Foundation . Date ( ) ) ) 📱 \( process. processName) [ \( process. processIdentifier) : \( threadId) ] 📂 \( file) ( \( line) ) ⚙️ \( funcname) ➡️ \r \t \( output) "
73+ let logText = " \n \( level. description ( ) ) . \( level) ⏱ \( dateFormatter. string ( from: Foundation . Date ( ) ) ) 📱 \( process. processName) [ \( process. processIdentifier) : \( threadId) ] 📂 \( file) ( \( line) ) ⚙️ \( funcname) ➡️ \r \t \( output) "
7474 if Stuff . minimumLogLevel == . productionLogAll {
75- if #available( iOSApplicationExtension 10 . 0 , * ) {
75+ if #available( iOS 10 . 0 , * ) {
7676 let log = OSLog ( subsystem: Bundle . main. bundleIdentifier!, category: " Stuff " )
7777 os_log ( " %{public}@ " , log: log, logText)
7878 } else {
0 commit comments