Skip to content

Latest commit

 

History

History
242 lines (185 loc) · 6.93 KB

README.en.md

File metadata and controls

242 lines (185 loc) · 6.93 KB

LogViewer

🌏 한국어

🚩 Table of Contents

Overview

  • LogViewer enables users to view Unity logs with device system information on the screen and to call APIs registered by developers.

Installation

  1. Install Game Package Manger
  2. Run : Unity Menu > Tools > GPM > Manager
  3. Service installation : LogViewer

Specification

Unity Support Version

  • 2018.4.0 or higher

Features

Console

  • Display the Unity logs on the screen.
  • View only the desired logs using the Category or Filter features.
  • Enable or disable the log type you need.
  • Send logs via email

console

  1. Menu

    • Category
    • Filter
      • Search
        • Print out only such logs that contain input characters.
      • Ignore Case
        • Select: Case sensitive
        • Clear: Case insensitive
    • Play Time
      • Configure whether to display the time elapsed from the start of an app to when a log is created.
      • Displays in seconds.
    • Scene
      • Configure whether to display the name of the scene in playing when there is a log.
    • Send Mail
      • Send all logs to specified email address.
    • Save Log File
      • Save the entire log to a local file.
    • Clear
      • Delete all logs.
  2. Log Type

    • logtype_info
      • Check log count of the LogType.Log type.
    • logtype_warning
      • Check log count of the LogType.Warning type.
    • logtype_error
      • Check log count of the LogType.Assert, LogType.Error, and LogType.Exception types.
    • Click each log type to enable or disable it.
  3. Log View

    • Check the list of logs.
  4. Log Details

    • View details of a selected log from the list.

Function

  • User can call APIs added by developers from LogViewer.

function

  1. Cheat Key
    • Pass string entered with callback registered through the AddCheatKeyCallback API.
  2. Command
    • Call API registered by using the AddCommand API.

System

  • View the device system information.

system

  • Update Button
    • Update system information.

🔨 Usage

Preparation

  • Configuring GpmLogViewer GameObject
    • Add the GPM/LogViewer/Prefabs/GpmLogViewer.prefab file to the scene.
    • Configuring Inspector
      inspector
      • Set Gesture Enable
        • Enable or disable LogView gesture.
      • Set Opener Enable
        • Enable or disable the UI that activates Log View.
      • Mail Setting
        • To: The Recipient's email address
        • User Name: Sender's email address
        • User Password: Sender's email password
        • Smtp Host: SMTP Host
        • Smpt Port: SMTP Port
        • Cc: Email address to be added for reference)

Precautions for Email Setting

  • All Platforms

    • Change API compatibility level to .NET 2.0 or above, or .NET Standard 2.0 or above.
  • iOS

    • When building using IL2CPP, create link.xml under the Assets folder and include the following.
      <linker>
          <assembly fullname="System">
              <type fullname="System.Net.Configuration.MailSettingsSectionGroup" preserve="all"/>
              <type fullname="System.Net.Configuration.SmtpSection" preserve="all"/>
              <type fullname="System.Net.Configuration.SmtpNetworkElement" preserve="all"/>
              <type fullname="System.Net.Configuration.SmtpSpecifiedPickupDirectoryElement" preserve="all"/>
          </assembly>
      </linker>
  • Configuring Gmail

    • Must be set using app password.

    • Allow less secure apps will be unavailable after May 31, 2022.

      • To : The Recipient's email address
      • User Name : User Name: Sender's email address
      • User Password : [app password] of the sending Sender's email address
      • Smtp Host : smtp.gmail.com
      • Smtp Port : 587

Configuring gmail app password

  1. Select the Security tab in your Google Account.

google_app_password_1_en

  1. In the Security tab, under Signing in to Google, select App password.
    • 2-Step Verification must be enabled to set the App password.

google_app_password_2_en

  1. Under App password, tap Select app.

google_app_password_3_en

  1. In the app selection area, tap Other (Custom Name).

google_app_password_4_en

  1. Put Smtp Client in the name to Generate it.

google_app_password_5_en

  1. For User Password, use the app password for your device.

google_app_password_6_en

Enabling LogViewer in Runtime

  • Enabling Each Platform

    • All Platforms
      • Use the Back Quote Key to enable. (Gesture Enable)
        • backquote
      • Click the Log button to activate it. (Opener Enable)
        • img.png
    • iOS/Android
      • Use a gesture to enable iOS/Android platforms. (Opener Enable)
        • Touch the screen with five fingers for one second.
  • The following types of logs automatically trigger the LogViewer.

    • LogType.Error
    • LogType.Exception

Code

NameSpace

using Gpm.LogViewer;

Console

  1. Category

    • Inputting Categories
      Debug.Log(GpmLogViewer.Instance.MakeLogWithCategory("TestLog", "UserCategory"));
  2. Log Type

    • Log
      Debug.Log("");
    • Warnning
      Debug.LogWarning("");
    • Assert/Error/Exception
      Debug.LogAssertion("");
      Debug.LogError("");
      Debug.LogException("");

Command

  1. Cheat Key
    • Adding Cheat Keys
      public void AddCheatKeySample()
      {
          Function.Instance.AddCheatKeyCallback((cheatKey) =>
          {
              Debug.Log("Call cheat key callback with : " + cheatKey);
          });
      }
  2. Command
    • Adding Commands
      private void TestCommand(int index)
      {       
          Debug.Log("Index : " + index);         
      }
      
      public void AddCommandSample()
      {
          Function.Instance.AddCommand(this, "TestCommand", new object[] { 2 });
      }