Skip to content
This repository was archived by the owner on Jul 7, 2024. It is now read-only.
This repository was 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

Description

@Cpt-Dingus

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]});
    }```

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions