File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -109,22 +109,22 @@ func _on_data() -> void:
109
109
PhxEvents .REPLY :
110
110
if _check_response (data ) == 0 :
111
111
pass
112
- print_debug ("Received reply = " + to_json (data ))
112
+ get_parent (). get_parent (). _print_debug ("Received reply = " + to_json (data ))
113
113
PhxEvents .JOIN :
114
114
if _check_response (data ) == 0 :
115
115
pass
116
- print_debug ("Joined topic '%s '" % data .topic )
116
+ get_parent (). get_parent (). _print_debug ("Joined topic '%s '" % data .topic )
117
117
PhxEvents .LEAVE :
118
118
if _check_response (data ) == 0 :
119
119
pass
120
- print_debug ("Left topic '%s '" % data .topic )
120
+ get_parent (). get_parent (). _print_debug ("Left topic '%s '" % data .topic )
121
121
PhxEvents .CLOSE :
122
122
pass
123
- print_debug ("Channel closed." )
123
+ get_parent (). get_parent (). _print_debug ("Channel closed." )
124
124
PhxEvents .ERROR :
125
125
emit_signal ("error" , data .payload )
126
126
SupabaseEvents .DELETE , SupabaseEvents .INSERT , SupabaseEvents .UPDATE :
127
- print_debug ("Received %s event..." % data .event )
127
+ get_parent (). get_parent (). _print_debug ("Received %s event..." % data .event )
128
128
var channel : RealtimeChannel = get_channel (data .topic )
129
129
if channel != null :
130
130
channel ._publish (data )
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ var database : SupabaseDatabase
7
7
var realtime : SupabaseRealtime
8
8
var storage : SupabaseStorage
9
9
10
+ var debug : bool = false
11
+
10
12
var config : Dictionary = {
11
13
"supabaseUrl" : "" ,
12
14
"supabaseKey" : ""
@@ -48,3 +50,9 @@ func load_nodes() -> void:
48
50
add_child (database )
49
51
add_child (realtime )
50
52
add_child (storage )
53
+
54
+ func debug (debugging : bool ) -> void :
55
+ debug = debugging
56
+
57
+ func _print_debug (msg : String ) -> void :
58
+ if debug : print_debug (msg )
You can’t perform that action at this time.
0 commit comments