GodotLogger 4.0

An asset by Nines2B
The page banner background of a mountain and forest
GodotLogger 4.0 hero image

Quick Information

0 ratings
GodotLogger 4.0 icon image
Nines2B
GodotLogger 4.0

JSON-formatted logger**Feature Highlights:**1. **Flexible Log Levels:** With Log, you have full control over the level of detail you want in your logs. Choose from DEBUG, INFO, WARN, ERROR, or FATAL log levels to focus on what truly matters.2. **Customizable Prefix and Arguments:** Personalize your logs by adding prefixes and custom arguments. Tailor your messages to suit your specific needs, making debugging a breeze.3. **Automatic Log File Generation:** Log ensures that your logs are stored safely and systematically. Choose to write logs to a file with just a simple configuration setting.4. **Thread-Safe Debugging:** Debugging outside the main thread? No problem! Log will alert you and provide debug information while maintaining thread safety.5. **JSON Serialization:** Seamlessly serialize your log messages to JSON format. This feature simplifies log analysis and enhances data readability.**Example**:GodotLogger.info("current node",self)...INFO [31/7/2023 17:13:30] current node {"auto_start":-1,"current_members":0,"editor_description":"","lobby_id":0,"lobby_mode":"default","lobby_name":"Test","max_memebers":4,"meta":{},"min_members":1,"name":"","process_mode":0,"process_physics_priority":0,"process_priority":0,"process_thread_group":0,"process_thread_group_order":0,"process_thread_messages":0,"scene_file_path":"","unique_name_in_owner":false,"visablity":2}

Supported Engine Version
4.0
Version String
1.1.3
License Version
MIT
Support Level
community
Modified Date
1 month ago
Git URL
Issue URL

GodotLogger

JSON-formatted logger

Settings

var CURRENT_LOG_LEVEL=LogLevel.INFO
var write_logs:bool = false
var log_path:String = "res://game.log"

Singletons

GodotLogger

  • GodotLogger.debug(msg,data)
  • GodotLogger.info(msg,data)
  • GodotLogger.warn(msg,data)
  • GodotLogger.error(msg,data)
  • GodotLogger.fatal(msg,data)

Classes

Log

Is the class implementation of the singleton logger. The CURRENT_LOG_LEVEL can be set to any of the following levels:

enum LogLevel {
    DEBUG,
    INFO,
    WARN,
    ERROR,
    FATAL,
}

When it is set anything less than the current log level will be filtered out

JsonData

Methods

  • marshal(obj:Object,compact:bool=false,compressMode:int=-1,skip_whitelist:bool=false) -> PackedByteArray:

  • unmarshal(dict:Dictionary,obj:Object,compressMode:int=-1) -> bool:

  • unmarshal_bytes_to_dict(data:PackedByteArray,compressMode:int=-1) -> Dictionary:

  • unmarshal_bytes(data:PackedByteArray,obj:Object,compressMode:int=-1) -> bool:

  • to_dict(obj:Object,compact:bool,skip_whitelist:bool=false) ->Dictionary:

Config

Will get either flags or env vars for the program and return the value or the default value.

Methods

  • get_var(name,default=""):

  • get_int(name,default=0) -> int:

  • get_bool(name,default=false,prefix:String="") -> bool:

  • get_custom_var(name,type,default=null):

JSON-formatted logger

**Feature Highlights:**

1. **Flexible Log Levels:** With Log, you have full control over the level of detail you want in your logs. Choose from DEBUG, INFO, WARN, ERROR, or FATAL log levels to focus on what truly matters.

2. **Customizable Prefix and Arguments:** Personalize your logs by adding prefixes and custom arguments. Tailor your messages to suit your specific needs, making debugging a breeze.

3. **Automatic Log File Generation:** Log ensures that your logs are stored safely and systematically. Choose to write logs to a file with just a simple configuration setting.

4. **Thread-Safe Debugging:** Debugging outside the main thread? No problem! Log will alert you and provide debug information while maintaining thread safety.

5. **JSON Serialization:** Seamlessly serialize your log messages to JSON format. This feature simplifies log analysis and enhances data readability.

**Example**:

GodotLogger.info("current node",self)
...

INFO [31/7/2023 17:13:30] current node {"auto_start":-1,"current_members":0,"editor_description":"","lobby_id":0,"lobby_mode":"default","lobby_name":"Test","max_memebers":4,"meta":{},"min_members":1,"name":"","process_mode":0,"process_physics_priority":0,"process_priority":0,"process_thread_group":0,"process_thread_group_order":0,"process_thread_messages":0,"scene_file_path":"","unique_name_in_owner":false,"visablity":2}

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
GodotLogger 4.0 icon image
Nines2B
GodotLogger 4.0

JSON-formatted logger**Feature Highlights:**1. **Flexible Log Levels:** With Log, you have full control over the level of detail you want in your logs. Choose from DEBUG, INFO, WARN, ERROR, or FATAL log levels to focus on what truly matters.2. **Customizable Prefix and Arguments:** Personalize your logs by adding prefixes and custom arguments. Tailor your messages to suit your specific needs, making debugging a breeze.3. **Automatic Log File Generation:** Log ensures that your logs are stored safely and systematically. Choose to write logs to a file with just a simple configuration setting.4. **Thread-Safe Debugging:** Debugging outside the main thread? No problem! Log will alert you and provide debug information while maintaining thread safety.5. **JSON Serialization:** Seamlessly serialize your log messages to JSON format. This feature simplifies log analysis and enhances data readability.**Example**:GodotLogger.info("current node",self)...INFO [31/7/2023 17:13:30] current node {"auto_start":-1,"current_members":0,"editor_description":"","lobby_id":0,"lobby_mode":"default","lobby_name":"Test","max_memebers":4,"meta":{},"min_members":1,"name":"","process_mode":0,"process_physics_priority":0,"process_priority":0,"process_thread_group":0,"process_thread_group_order":0,"process_thread_messages":0,"scene_file_path":"","unique_name_in_owner":false,"visablity":2}

Supported Engine Version
4.0
Version String
1.1.3
License Version
MIT
Support Level
community
Modified Date
1 month ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers