SDL_LogCategory(3type)

πŸ’– SDL_LogCategory β€” the SDL3 DATATYPES tea πŸ’–

okay bestie, pull up a chair, because we're talking about SDL_LogCategory, straight out of the SDL3 datatypes section. it's an enum, it's iconic, and it's literally just a list of the predefined log categories. that's it. that's the whole girl. ✨


🌸 NAME 🌸

SDL_LogCategory β€” the predefined log categories πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

no cap, this is the whole thing. copy it exactly, don't freestyle:

#include <SDL3/SDL_log.h>

typedef enum SDL_LogCategory
{
    SDL_LOG_CATEGORY_APPLICATION,
    SDL_LOG_CATEGORY_ERROR,
    SDL_LOG_CATEGORY_ASSERT,
    SDL_LOG_CATEGORY_SYSTEM,
    SDL_LOG_CATEGORY_AUDIO,
    SDL_LOG_CATEGORY_VIDEO,
    SDL_LOG_CATEGORY_RENDER,
    SDL_LOG_CATEGORY_INPUT,
    SDL_LOG_CATEGORY_TEST,
    SDL_LOG_CATEGORY_GPU,

    /* Reserved for future SDL library use */
    SDL_LOG_CATEGORY_RESERVED2,
    SDL_LOG_CATEGORY_RESERVED3,
    SDL_LOG_CATEGORY_RESERVED4,
    SDL_LOG_CATEGORY_RESERVED5,
    SDL_LOG_CATEGORY_RESERVED6,
    SDL_LOG_CATEGORY_RESERVED7,
    SDL_LOG_CATEGORY_RESERVED8,
    SDL_LOG_CATEGORY_RESERVED9,
    SDL_LOG_CATEGORY_RESERVED10,

    /* Beyond this point is reserved for application use, e.g.
       enum {
           MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM,
           MYAPP_CATEGORY_AWESOME2,
           MYAPP_CATEGORY_AWESOME3,
           ...
       };
     */
    SDL_LOG_CATEGORY_CUSTOM
} SDL_LogCategory;

see those SDL_LOG_CATEGORY_RESERVED2 through SDL_LOG_CATEGORY_RESERVED10? yeah, those are reserved for future SDL library use β€” so hands off, they're not yours, SDL is holding them for later. πŸ™ˆ

and past that? everything beyond is reserved for application use, so you can start your own enum at SDL_LOG_CATEGORY_CUSTOM and name your categories whatever your little heart desires. MYAPP_CATEGORY_AWESOME1 is genuinely a real example in the source, and honestly? slay. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

ok so by default, here's the vibe check on what's enabled and at what level:

  • the application and gpu categories are enabled at the INFO level
  • the assert category is enabled at the WARN level
  • test is enabled at the VERBOSE level
  • and all other categories are enabled at the ERROR level

that's the whole default situation. no notes. 🫢


⭐ AVAILABILITY ⭐

this enum is available since SDL 3.2.0. she's been around, she's stable, she ate. πŸ”₯


quick reminder bestie: those RESERVED2–RESERVED10 values are not for you. don't assign them, don't count on them, just let SDL do its thing. iykyk. πŸ’€

and that's the page!! brought to you by the lovely humans at Simple Directmedia Layer, rocking version SDL 3.4.18, filed under SDL_LogCategory(3type) in the SDL3 datatypes era. mwah, go log something cute. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from