tmijs / tmi.js

💬 Javascript library for the Twitch Messaging Interface. (Twitch.tv)
https://tmijs.com
MIT License
1.54k stars 217 forks source link

How to remove chat log by default #404

Closed samuelkampf closed 4 years ago

samuelkampf commented 4 years ago

So I cant seem to find documentation on how to stop tmi from logging all chat from channels that you are in. Is it possible to change this without altering the code itself?

Actual behaviour:

Expected behaviour:

Error log:

Insert your error log here

Server configuration

samuelkampf commented 4 years ago

i simply just dont wanna see what messages come from other channels

AlcaDesign commented 4 years ago

The debug option sets the default logger to the "info" level. Remove it to default to the "error" level. You can supply your own logger or set the level lower to "warn" to get more information without the chat.

client.log.setLevel('warn');
samuelkampf commented 4 years ago

but warn doesnt show the joining of channels thats what i would like to keep @AlcaDesign

AlcaDesign commented 4 years ago

Add an event handler for the "join" and "part" events. There's no other distinction between chat and join/part to the logger.

Example:

client.on('join', (channel, username, self) => {
    if(self) {
        client.log.warn(`Joined ${channel}`);
    }
});