Skip to content

Commit d37b47d

Browse files
authored
fix: Log levels (#333)
Recently the default log level setting was changed from *All* to *Debug*. Since the project used these default values, they were not written to disk. However, when these values were retrieved with `ProjectSettings.get_setting`, the default was specified as *All*. So the project settings contained the ( default ) value of *Debug*, which was not saved ( since it had the default value ), and then read as *All*. Fixes #330
1 parent 7b16bbf commit d37b47d

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

addons/netfox.extras/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="netfox.extras"
44
description="Game-specific utilities for Netfox"
55
author="Tamas Galffy"
6-
version="1.12.2"
6+
version="1.12.3"
77
script="netfox-extras.gd"

addons/netfox.internals/logger.gd

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ enum {
1111
LOG_MAX
1212
}
1313

14+
const DEFAULT_LOG_LEVEL := LOG_DEBUG
15+
1416
static var log_level: int
1517
static var module_log_level: Dictionary
1618

@@ -27,14 +29,6 @@ const level_prefixes: Array[String] = [
2729
""
2830
]
2931

30-
static func _static_init():
31-
log_level = ProjectSettings.get_setting("netfox/logging/log_level", LOG_MIN)
32-
module_log_level = {
33-
"netfox": ProjectSettings.get_setting("netfox/logging/netfox_log_level", LOG_MIN),
34-
"netfox.noray": ProjectSettings.get_setting("netfox/logging/netfox_noray_log_level", LOG_MIN),
35-
"netfox.extras": ProjectSettings.get_setting("netfox/logging/netfox_extras_log_level", LOG_MIN)
36-
}
37-
3832
static func for_netfox(p_name: String) -> _NetfoxLogger:
3933
return _NetfoxLogger.new("netfox", p_name)
4034

@@ -47,12 +41,20 @@ static func for_extras(p_name: String) -> _NetfoxLogger:
4741
static func make_setting(name: String) -> Dictionary:
4842
return {
4943
"name": name,
50-
"value": LOG_DEBUG,
44+
"value": DEFAULT_LOG_LEVEL,
5145
"type": TYPE_INT,
5246
"hint": PROPERTY_HINT_ENUM,
5347
"hint_string": "All,Trace,Debug,Info,Warning,Error,None"
5448
}
5549

50+
static func _static_init():
51+
log_level = ProjectSettings.get_setting("netfox/logging/log_level", DEFAULT_LOG_LEVEL)
52+
module_log_level = {
53+
"netfox": ProjectSettings.get_setting("netfox/logging/netfox_log_level", DEFAULT_LOG_LEVEL),
54+
"netfox.noray": ProjectSettings.get_setting("netfox/logging/netfox_noray_log_level", DEFAULT_LOG_LEVEL),
55+
"netfox.extras": ProjectSettings.get_setting("netfox/logging/netfox_extras_log_level", DEFAULT_LOG_LEVEL)
56+
}
57+
5658
func _init(p_module: String, p_name: String):
5759
module = p_module
5860
name = p_name

addons/netfox.internals/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="netfox.internals"
44
description="Shared internals for netfox addons"
55
author="Tamas Galffy"
6-
version="1.12.2"
6+
version="1.12.3"
77
script="plugin.gd"

addons/netfox.noray/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="netfox.noray"
44
description="Bulletproof your connectivity with noray integration for netfox"
55
author="Tamas Galffy"
6-
version="1.12.2"
6+
version="1.12.3"
77
script="netfox-noray.gd"

addons/netfox/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="netfox"
44
description="Shared internals for netfox addons"
55
author="Tamas Galffy"
6-
version="1.12.2"
6+
version="1.12.3"
77
script="netfox.gd"

0 commit comments

Comments
 (0)