HiDeubg-unity log extension plugin (free)

#HiDebug_unity

how to use

The latest unity package can be downloaded from this link:Github Releases

Or download from unity asset store: https://www.assetstore.unity3d.com/en/#!/content/104658


Function

  • Multi-platform support (unity editor, exe, Android, iOS, WP...).
  • One-click switch log (open log in development mode, one-click close in release mode).
  • Whether to print the log to the screen (even without connecting to Android studio, xcode can view the log)
  • Whether to record the log to text (the default path is persistentdatapath, you can view the log when the program crashes)
  • Automatically add timestamps to logs.
  • Display stack information on the screen or record stack information to text.
  • All functions are in a dll, which can be directly copied to the project for use.

Details

  1. Console log:
Debuger.EnableHiDebugLogs(true);

If you use Debuger.Log or Debuger.LogWarnning or Debuger.LogError to print logs, you can turn off these logs with one click Debuger.EnableHiDebugLogs(false).

At the same time, your logs will also be automatically timestamped.

Of course, you tend to use the Debug.Log of the unity engine to print logs, which can also be printed on the screen or recorded in txt.

  1. log to text:
Debuger.EnableOnText(true);

Will log and stack information to text, the default path is Application.persistentDataPath.

  1. Print log to screen:
Debuger.EnableOnScreen(true);

A button will be displayed that can be dragged anywhere (where it doesn't obscure your game buttons)

When this button is clicked, a panel will pop up showing the log and stack.

  • Click on each log to display its stack information.
  • Check log or warning or error to display only this type of log.
  • Clear all logs on the screen.
  • Close the log display panel
  • Sets the font size on the screen.


Example1

void Start()
    {
        Use_Debug();
        Use_Debuger();
    }

    /// <summary>
    /// use debuger, you can enable or disable logs just one switch
    /// and also it automatically add time to your logs 
    /// </summary>
    void Use_Debuger()
    {
        //you can set all debuger's out put logs disable just set this value false(pc,android,ios...etc)
        //it's convenient in release mode, just set this false, and in debug mode set this true.
        Debuger.EnableHiDebugLogs(true);
        //Debuger.EnableHiDebugLogs(false);

        Debuger.EnableOnText(true);
        Debuger.EnableOnScreen(true);

        for (int i = 0; i < 100; i++)
        {
            Debuger.Log(i);
            Debuger.LogWarning(i);
            Debuger.LogError(i);
        }
    }

    /// <summary>
    /// if you donnt want use Debuger.Log()/Debuger.LogWarnning()/Debuger.LogError()
    /// you can still let UnityEngine's Debug on your screen or write them into text
    /// </summary>
    void Use_Debug()
    {
        Debuger.EnableOnText(true);
        Debuger.EnableOnScreen(true);

        for (int i = 0; i < 100; i++)
        {
            Debug.Log(i);
            Debug.LogWarning(i);
            Debug.LogError(i);
        }
    }

Example2

[SerializeField]
    private bool _isLogOn;//set this value from inspector
    [SerializeField]
    private bool _isLogOnText;
    [SerializeField]
    private bool _isLogOnScreen;
    // Use this for initialization
    void Start()
    {
        Debuger.EnableHiDebugLogs(_isLogOn);
        Debuger.EnableOnText(_isLogOnText);
        Debuger.EnableOnScreen(_isLogOnScreen);

        for (int i = 0; i < 100; i++)
        {
            Debuger.Log(i);
            Debuger.LogWarning(i);
            Debuger.LogError(i);
        }

        Debuger.FontSize = 20;//set size of font
    }

Example3

Using the Unity engine's Debug.Log, you can still print logs to the screen, or log to text.

[SerializeField]
    private bool _isLogOnText;
    [SerializeField]
    private bool _isLogOnScreen;
    // Use this for initialization
    void Start()
    {
        Debuger.EnableOnText(_isLogOnText);
        Debuger.EnableOnScreen(_isLogOnScreen);


        //unity engine's debug.log
        for (int i = 0; i < 100; i++)
        {
            Debug.Log(i);
            Debug.LogWarning(i);
            Debug.LogError(i);
        }
    }

support: [email protected]

QQ group: 83596104

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325478641&siteId=291194637