Developing a Tiny Logger in Swift
Sauvik Dolui

I can find some issues in your logger.

  1. It have to be placed in main bundle (in application project) otherwise preprocessor directives wont work.
  2. You should use autoclosure instead of string as parameter. 
    func log(_ message: @autoclosure () -> String) { ... } 
    This will prevent calling concatenation or calculation if you run production code
  3. You should use Any instead of String in your logger API. This allow you to type something like: Logger.log(Date(), event: .s) or any other think which can be printed (structures, classes, etc)
  4. Think about redesign your API
    Log is shorted than Logger (less typing)
    func log(message: String) should looks like func log(_ message: String) (less typing)
    I would prefer logger API like:
    Log.debug(“This is debug message”)
     Log.error(error.description + “ while downloading file”)