 */
 
 struct SprigLogger {
+
+    struct SprigGlobal {
+
+        private var logger: SprigLogger = SprigLogger(name: "sprig", appender: SprigConsoleAppender(), level: SprigLevel.INFO)
+        var name: String
+        {
+            get
+            {
+                return logger.name
+            }
+        }
+        var appender: SprigAppender
+        {
+            get
+            {
+                return logger.appender
+            }
+            set(appender)
+            {
+                logger.appender = appender
+            }
+        }
+        var level: SprigLevel
+        {
+            get
+            {
+                return logger.level
+            }
+            set(level)
+            {
+                logger.level = level
+            }
+        }
+
+        init() {
+            if let levelEnv = NSProcessInfo.processInfo().environment[SPRIG_LEVEL] {
+                if levelEnv == "10" || "TRACE".caseInsensitiveCompare(levelEnv) == NSComparisonResult.OrderedSame {
+                    level = SprigLevel.TRACE
+                } else if levelEnv == "20" || "DEBUG".caseInsensitiveCompare(levelEnv) == NSComparisonResult.OrderedSame {
+                    level = SprigLevel.DEBUG
+                } else if levelEnv == "30" || "INFO".caseInsensitiveCompare(levelEnv) == NSComparisonResult.OrderedSame {
+                    level = SprigLevel.INFO
+                } else if levelEnv == "40" || "WARN".caseInsensitiveCompare(levelEnv) == NSComparisonResult.OrderedSame {
+                    level = SprigLevel.WARN
+                } else if levelEnv == "50" || "ERROR".caseInsensitiveCompare(levelEnv) == NSComparisonResult.OrderedSame {
+                    level = SprigLevel.ERROR
+                } else if levelEnv == "60" || "FATAL".caseInsensitiveCompare(levelEnv) == NSComparisonResult.OrderedSame {
+                    level = SprigLevel.FATAL
+                }
+            }
+        }
+    }
 
     private static let SPRIG_LEVEL: String = "SPRIG_LEVEL"
     private static var isoFormatter: NSDateFormatter

        logString += SprigEntry(key: "name", value: name).description + ","
        logString += SprigEntry(key: "msg", value: "message").description
        logString += "}"
        
        appender.write(logString)
    }

    func trace(entry: SprigLoggable)


        return formatter
    }
    static var global: SprigGlobal = SprigGlobal()

    var level: SprigLevel
    var appender: SprigAppender
    let name: String

