Cobra Logging

Unity's default debug class may meet fundamental needs, but more complex projects often call for a deeper, more nuanced logging system. Equip yourself with a logging solution built to support you throughout your entire development cycle.


Multi-Tiered Logging:

Capture messages across various levels: Debug, Info, Warning, Assert, Error, and Fatal.


Interactive logs: Click on any log within Unity to be taken directly to its origin in your favorite code editor.


Sample log display:

Every log displays crucial data: timestamp, log type, originating file, and exact line.


10:00:30 [INFO] MyScript[123]: This is a test log message.


The example above is generated from the file MyScript.cs on line 123 at 10:00:30. Most components of this log display can be customized to match your requirements.


Deep Customization:

Easily modify tags, colors, and even overhaul logs via code or inspector. Choose to halt execution for Asserts and Errors. Fatal logs always halt execution, but an optional 'quit' parameter offers an added layer of security. Logs can also be routed to multiple destinations, such as an in-game console or log server.


Save Object States:

Save states within logs, capturing the full context of each event. Save almost any C# object through JSON serialization.


Save Logs To Files:

This feature allows for the automatic saving of log entries to designated files, ensuring a permanent record of system events and activities for review and analysis.


Thread Safety:

Use multi-threading without logfile access errors.


Flexible Filtering:

Comes with pre-configured filters for Namespaces and Directories. These filters can filter out logs based on namespaces or script file directories. Configure them either via the custom inspector or directly through C#.


Asserts:

Simplify debugging with the Assert helper class, automatically capturing variable names and conditions in your logs for quick issue identification.


Performance and Memory Monitoring

Includes easy to use but powerful classes for measuring code execution times and memory usage, respectively.


Test Suite Included:

Modify this asset with confidence. This asset comes with automatic Nunit tests so if you want to modify this asset you can easily verify that everything still works.


Full Source Code Access:

Explore the code and make it your own.