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

README does not describe how to set LOG_LEVEL when using with Swift-log #76

Open
peakman opened this issue Jun 4, 2020 · 2 comments
Open

Comments

@peakman
Copy link

peakman commented Jun 4, 2020

I am using the HeliumStreamLogger with Swift-log Logging. I followed the README and used LoggingSystem.bootstrap(myStreamlogger.makeLogHandler).
The LogHandler created from the above has a hard-coded .info level and it took me a long time to work out how to change it. Maybe there are easier ways, but the following code works and I think it should be included in the README.

var handler = myStreamLogger.makeHandler(label: "StreamLogger")
handler.logLevel = .debug
LoggingSystem.bootstrap({ name in {return handler})
@ratkins
Copy link

ratkins commented Jul 27, 2020

I'm using

HeliumLogger.bootstrapSwiftLog { logger in
// ...
}

And I still can't work it out. Where does your myStreamHandler come from?

@peakman
Copy link
Author

peakman commented Jul 27, 2020

myStreamLogger is a HeliumStreamLogger that I create using
HeliumStreamLogger( outputStream: makeLogStream()) where makeLogStream() is a function that returns an output stream.

I use myStreamLogger to create the handler.

I think the code should work equally well with a normal HeliumLogger.

I do not use HeliumLogger.bootstrapSwiftLog at all.

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

2 participants