diff --git a/addons/loggie/tools/loggie_tools.gd b/addons/loggie/tools/loggie_tools.gd index 9b94e58..cdc3f5a 100644 --- a/addons/loggie/tools/loggie_tools.gd +++ b/addons/loggie/tools/loggie_tools.gd @@ -19,7 +19,7 @@ static func concatenate_msg_and_args(msg : Variant, arg1 : Variant = null, arg2 var arguments = [arg1, arg2, arg3, arg4, arg5, arg6] for arg in arguments: if arg != null: - final_msg += (" " + convert_to_string(arg)) + final_msg += ", [ %s ]" % convert_to_string(arg) return final_msg ## Converts [param something] into a string. @@ -31,6 +31,23 @@ static func convert_to_string(something : Variant) -> String: result = JSON.new().stringify(something, " ", false, true) elif something is LoggieMsg: result = str(something.string()) + + elif something is Object: + return "%s: %s" % [something.get_class(), something.to_string()] + + elif something is Vector2: + return "Vector2: %s" % str(something) + elif something is Vector2i: + return "Vector2i: %s" % str(something) + elif something is Vector3: + return "Vector3: %s" % str(something) + elif something is Vector3i: + return "Vector3i: %s" % str(something) + + elif something is Color: + var html:String = something.to_html() + return "Color: {%s} [color=%s]#%s[/color]" % [str(something), html, html] + else: result = str(something) return result diff --git a/test/test.gd b/test/test.gd index b03d69a..5feb8c9 100644 --- a/test/test.gd +++ b/test/test.gd @@ -43,6 +43,8 @@ func test_all_log_level_outputs(): Loggie.msg("Test logging methods").box(25).info() Loggie.msg("Test info").info() Loggie.msg("Test", "info", "multi", "argument").info() + Loggie.msg("Test", 50, get_viewport(), AudioServer).info() + Loggie.msg("Test", Color.RED, Vector2.UP, Vector2i.ONE).info() Loggie.msg("Test error.").error() Loggie.msg("Test warning.").warn() Loggie.msg("Test notice.").notice()