Skip to content

An unitypackage of customizing console log format with user-defined functions, and optionally export log to file.

Notifications You must be signed in to change notification settings

k-s-studio/Unity-CustomLogHandler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity CustomLogHandler

features:

  • Replace Unity logHandler with custom class, and do something cool before return the message to console.
  • Accept user-defined method of modifying the log format or adding extra information.
  • Optionally export logs to file.
  • An Editor script to switch On/Off in editor menu.
  • An MonoBehaviour script of Load/Remove controls in runtime.

usage:

  1. Import the .unitypackage from unity IDE menu.
  2. Modify CustomLogConfig.cs to customize the behaviour.
  3. Turn on the LogHandler in IDE toolbar: CustomTools > CustomLogHandler > On, or add component CustomLogRuntime.cs to gameObject in scenes.
  4. Call native UnityEngine.Debug.Log() etc. in your scripts as normal. The custom behaviours automatically apply.

claim:

Small of this project is derived from AI-generated code. It was copied from Google's AI summary of Google search, then organized and expanded functionality by me. I don't know who the very original author is, and I do not intend to claim the copyright.
I probably will ask AI for optimization and extension advice in the future.

TODOs:

  • 輸出日誌到.txt是否在非windows平台造成bug的確認
  • 從Menu開/關
  • 避免重複Load導致self-cycle
  • partial class或json設定檔?
  • 輸出日誌開/關、輸出位址&檔名設定
  • 訊息格式自定義
  • MonoBehaviour trigger
  • stackTrace實驗 & 實作我的Config

About

An unitypackage of customizing console log format with user-defined functions, and optionally export log to file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages