LoginSignup
6
1

More than 3 years have passed since last update.

[UE4]iniでログレベルを設定する

Last updated at Posted at 2019-12-05

前段

自分の担当部位は自分だけ常にログを出しておきたい
とか
しばらくレアバグのトラッキングのためにチーム全体の対象ログのレベルを上げておきたい
みたいな事ってありますよね。

もちろんコンソールコマンドとかコマンドラインオプションで入力するのもいいのですが、
iniファイルに記述することでも設定を適用することができます。

エンジンのソースファイルはこの辺り

LogSuppressionInterface.cpp
    virtual void ProcessConfigAndCommandLine()
    {
        // first we do the config values
        FConfigSection* RefTypes = GConfig->GetSectionPrivate(TEXT("Core.Log"), false, true, GEngineIni);
        if (RefTypes != NULL)
        {
            for( FConfigSectionMap::TIterator It(*RefTypes); It; ++It )
            {
                ProcessCmdString(It.Key().ToString() + TEXT(" ") + It.Value().GetValue(), true);
            }
        }

なにかハードコートされた文字列が見えますね!
そうです!
*Engine.iniの [Core.Log] セクションに書くことでLogLevelを設定することができます。

早速やってみよう

[YourProject]/Config/DefaultEngine.ini

[Core.Log]
LogBlueprintUserMessages=none
LogDerivedDataCache=all

起動してみます。

Cmd: log list BlueprintUserMessages
LogBlueprintUserMessages                  NoLogging     
Cmd: log list Derived
LogAudioDerivedData                       Log           
LogDerivedDataCache                       VeryVerbose   
LogDerivedDataCacheCommandlet             Log           

しっかり適用されているのが確認できました!
今回はDefaultEngine.iniに書いたのでバージョンコントロールを使ってチーム開発している方々はその後に(サブミット|コミット)することで、チーム全体に影響を与えることに注意してください。
もちろんSaved/Config/Windows/Engine.ini に追記すれば自分だけに設定を適用可能です!

DefaultEngine.iniの編集は影響範囲が大きいのでトラブルを避けるためにチームに確認を取って慎重に行いましょう!

6
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
1