Customizing Log Tags

In the CatLog library, you have the ability to set custom tags for all log types. This can be achieved either through the custom inspector in Unity or by using C# scripting. Here's an example of how to set a custom tag for info logs using C# scripting:

using UnityEngine;
using CatLog;

public class CustomLogBehaviour : MonoBehaviour
{
    private void Start()
    {
        // Set the custom tag for info logs
        Log.Settings.Tags.InfoTag = "[CUSTOM INFO TAG]:";

        // Log a message with the custom info tag
        Log.Info("A message");
        // Output: [CUSTOM INFO TAG]: CustomLogBehaviour.cs[11]: A message
    }
}

With this, you now have the ability to easily set custom tags for each log type and better identify the source of your logs in the console.

Last updated