Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Loglevel? #86

Closed
Appelg opened this issue Aug 25, 2020 · 2 comments
Closed

Loglevel? #86

Appelg opened this issue Aug 25, 2020 · 2 comments

Comments

@Appelg
Copy link

Appelg commented Aug 25, 2020

I can't figure out if it's possible to configure a minimum loglevel to send?
I want to disable debug/info-logs when going to production.

@albertodebortoli
Copy link
Member

Hi @Appelg yes you can on any destination (via the BaseDestination's minLevel property).

It's done via SwiftyBeaver, not JustLog per se.

E.g.

let minLogLevel: SwiftyBeaver.Level
switch <yourConfiguration> {
    case "verbose":
        minLogLevel = .verbose
    case "debug":
        minLogLevel = .debug
    case "info":
        minLogLevel = .info
    case "warning":
        minLogLevel = .warning
    case "error":
        minLogLevel = .error
    default:
        minLogLevel = .verbose
}
Logger.shared.logstash.minLevel = minLogLevel

@Appelg
Copy link
Author

Appelg commented Aug 30, 2020

Totally missed that, thanks!

@Appelg Appelg closed this as completed Aug 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants