DaveWoodCom / XCGLogger

A debug log framework for use in Swift projects. Allows you to log details to the console (and optionally a file), just like you would have with NSLog() or print(), but with additional information, such as the date, function name, filename and line number.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prevent logging LogDetail into file when open file

kukushi opened this issue · comments

First, thanks for your great work.

I'm using an AutoRotatingFileDestination with warning output level. The problem is, each time when the app opening the file, XCGLogger will log something like [Info] > XCGLogger appending log to... into the file. That's wired because my destination has a warning output level.

I'm wondering it's a bug or expected behavior?

let logDetails = LogDetails(level: .info, date: Date(), message: "XCGLogger " + (fileExists && shouldAppend ? "appending" : "writing") + " log to: " + writeToFileURL.absoluteString, functionName: "", fileName: "", lineNumber: 0, userInfo: XCGLogger.Constants.internalUserInfo)

This code use internal routine, so bypass the level control

Hello, I have the same question. Is there any way to customise the setup log level? Personally, I don't want the path of the logfile to be visible as I use it in a static library.