tulir / whatsmeow

Go library for the WhatsApp web multidevice API
https://go.mau.fi/whatsmeow
Mozilla Public License 2.0
2.25k stars 418 forks source link

Disable logs #26

Closed Ased2235 closed 2 years ago

Ased2235 commented 2 years ago

Is there anyway to disable debug logs? I can't seems to find it.

tulir commented 2 years ago

How do you not find it? :thinking:

Logs have to be explicitly enabled by passing a logger to NewClient (and sqlstore.New). Passing nil as the logger will disable logs entirely (as the NewClient docs say). The stdout logger implementation also requires you to explicitly pass the minimum log level when creating the logger.

Directly copied from the example:

clientLog := waLog.Stdout("Client", "DEBUG", true)
client := whatsmeow.NewClient(deviceStore, clientLog)