How-To: Set Up Per-Plugin Logging

Goal: give a plugin its own named, filterable log category using the CRIMSON_LOG_* macros. Every Crimson plugin uses these exclusively - never UE_LOG directly, and never DEFINE_LOG_CATEGORY_STATIC (static categories can't be filtered by name in the output log).

Prerequisites
This is a C++ task. The plugin's .Build.cs lists CrimsonCommon in PublicDependencyModuleNames, and its .uplugin declares CrimsonCommon in the Plugins array.

1. Declare the category (one header)

cpp
// Public/CrimsonMyPluginLog.h
#pragma once
#include "CrimsonLogging.h"
CRIMSON_DECLARE_LOG_CATEGORY(LogCrimsonMyPlugin)

2. Define it (module .cpp, once)

cpp
// CrimsonMyPluginModule.cpp
#include "CrimsonMyPluginLog.h"
CRIMSON_DEFINE_LOG_CATEGORY(LogCrimsonMyPlugin);

3. Log at call sites

cpp
#include "CrimsonMyPluginLog.h"
CRIMSON_LOG_INFO (LogCrimsonMyPlugin, TEXT("Bindings applied"))
CRIMSON_LOG_WARN (LogCrimsonMyPlugin, TEXT("Config is null"))
CRIMSON_LOG_ERROR(LogCrimsonMyPlugin, FString::Printf(TEXT("Tag [%s] not found"), *Tag.ToString()))
MacroVerbosityWhen to use
CRIMSON_LOG_VERBOSEVerbosePer-frame / high-frequency detail
CRIMSON_LOG_INFOLogNormal operational info
CRIMSON_LOG_DISPLAYDisplayShows in the PIE on-screen log
CRIMSON_LOG_WARNWarningUnexpected but recoverable
CRIMSON_LOG_ERRORErrorOperation failed
CRIMSON_LOG_FATALFatalUnrecoverable - flushes and crashes
Verify
Run the editor and type Log LogCrimsonMyPlugin Verbose in the console - your category is listed and filterable by name.