GithubHelp home page GithubHelp logo

shepherd0619 / overwatchunitylogger Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 12 KB

An enhanced logger for Unity.

License: BSD 3-Clause "New" or "Revised" License

C# 100.00%
editor gamedev logger unity unity3d

overwatchunitylogger's Introduction

OverwatchUnityLogger

English | δΈ­ζ–‡

OverwatchLog is a logging utility for Unity, providing a more flexible and customizable alternative to Unity's built-in Debug.Log functions. It allows you to log messages with different log types, colors, and context objects.

Features

  • Log messages with different log types: Log, Warning, Error, Assert, and TrueLog.
  • Customize log colors using the LogColor enum.
  • Attach context objects to log messages for better debugging.
  • More control over which log types to display with the MinLogType property.

Usage

  1. Import the OverwatchLog.cs script into your Unity project.
  2. Use the OverwatchLog.Log, OverwatchLog.Warn, OverwatchLog.Error, OverwatchLog.LogException, and OverwatchLog.Assert methods to log messages with different log types.
OverwatchLog.Log("This is a log message");
OverwatchLog.Warn("This is a warning message");
OverwatchLog.Error("This is an error message");
OverwatchLog.LogException(exception);
OverwatchLog.Assert(condition, "This is an assertion message");
  1. Customize log colors by modifying the LogColor enum.
public enum LogColor
{
    NONE = 0,
    BLUE,
    YELLOW,
    RED,
    GREEN,
    AQUA,
    WHITE,
}
  1. Attach context objects to log messages for better debugging.
OverwatchLog.Log("This is a log message", gameObject);
  1. Control which log types to display by modifying the MinLogType property.
OverwatchLog.MinLogType = OverwatchLogType.Warning;

Differences from Unity's Debug.Log

OverwatchLog provides additional features and flexibility compared to Unity's built-in Debug.Log functions:

  1. Log Types: OverwatchLog introduces different log types such as Warning, Error, Assert, and TrueLog, allowing for better categorization and organization of log messages.

  2. Log Colors: OverwatchLog allows you to customize log colors using the LogColor enum, making it easier to visually distinguish different types of log messages.

  3. Context Objects: OverwatchLog supports attaching context objects to log messages, providing additional information and context for debugging purposes.

  4. MinLogType: OverwatchLog's MinLogType property allows you to control which log types to display, giving you more control over the verbosity of your logs.

Best Practice

It is recommended for Unity headless build to implent this script.

If you are also using Springboot as a part of your Unity game server, this script can also help ya to make the log more obvious.

Contributions

Contributions to the script are welcome. If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.

overwatchunitylogger's People

Contributors

shepherd0619 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.