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

Logger doesn't respect the channel is not being set #50

Open
Cpt-Dingus opened this issue Nov 10, 2023 · 0 comments
Open

Logger doesn't respect the channel is not being set #50

Cpt-Dingus opened this issue Nov 10, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Cpt-Dingus
Copy link
Collaborator

The code and warning suggests there should be an early return should be present here

    // silence all logging channel event messages if an ID has not been set,
    // yet an attempt is still being made to log something
    if (loggingChannelId === '' && loggingLevel !== 0) {
      botConfig.logging.loggingChannel.verboseLevel = 0;
      logEvent(
        EventCategory.Warning,
        'core',
        'No logging channel ID has been set, to prevent this warning, set `logging.loggingChannel.verboseLevel` to 0 in the config. Logging through discord will be disabled until restart.',
        1
      );
    }
    // Sending the event to the logging channel
    if (loggingLevel >= verbosity) {
      /**
       * The actual {@link TextChannel} discord.js reference to the
       * event channel
       */
      const loggingChannel: TextChannel = client.channels.cache.get(
        loggingChannelId
      ) as TextChannel;

      void loggingChannel.send({embeds: [eventEmbed]});
    }```
@Cpt-Dingus Cpt-Dingus added the bug Something isn't working label Nov 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant