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 log output to multiple sources #2

Open
nhgrif opened this issue Sep 11, 2016 · 1 comment
Open

Support log output to multiple sources #2

nhgrif opened this issue Sep 11, 2016 · 1 comment

Comments

@nhgrif
Copy link

nhgrif commented Sep 11, 2016

From your README's TODO list:

print to a text file when used on a device

But competing logging libraries allow me to add different loggers. As an example:

    /**
     Adds CocoaLumberjack loggers to the project.
     */
    static func setUpLogging() {
        #if DEBUG
            setenv("XcodeColors", "YES", 0)
            DDLog.addLogger(xcodeConsoleLogger)
        #endif
        DDLog.addLogger(fileLogger)
        DDLog.addLogger(appleSystemLogger)
    }

I think in an ideal world, I'd be able to not only do this, but also specify the minimum logging level for each logger I attach. So for example, the Xcode console gets all log levels, but the file logger only gets debug and up, and the Apple system logger only gets warning and error.

@nhgrif
Copy link
Author

nhgrif commented Sep 11, 2016

As an additional note, these loggers we add in the above example can actually specify their custom formatter and organize the different parts of the log message however they want. This should be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant