File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
Assets/ConsentManagementProvider/Scripts/wrapper Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -6,17 +6,27 @@ public static class CmpDebugUtil
6
6
{
7
7
private static bool enableLogging = false ;
8
8
private static bool enableDebugging = false ;
9
+ private static bool forceEnableSingleLog ;
9
10
11
+ private static bool IsLoggingEnabled
12
+ {
13
+ get
14
+ {
15
+ var result = enableLogging || forceEnableSingleLog ;
16
+ forceEnableSingleLog = false ;
17
+ return result ;
18
+ }
19
+ }
20
+
10
21
static CmpDebugUtil ( )
11
22
{
12
23
EnableGarbageCollectorDebugging ( enableDebugging ) ;
13
24
EnableCmpLogs ( enableLogging ) ;
14
25
}
15
26
16
- public static void EnableCmpLogs ( bool enable )
17
- {
18
- enableLogging = enable ;
19
- }
27
+ public static void ForceEnableNextCmpLog ( ) => forceEnableSingleLog = true ;
28
+
29
+ public static void EnableCmpLogs ( bool enable ) => enableLogging = enable ;
20
30
21
31
public static void EnableGarbageCollectorDebugging ( bool enable )
22
32
{
@@ -26,19 +36,19 @@ public static void EnableGarbageCollectorDebugging(bool enable)
26
36
27
37
public static void Log ( string message )
28
38
{
29
- if ( enableLogging )
39
+ if ( IsLoggingEnabled )
30
40
Debug . Log ( message ) ;
31
41
}
32
42
33
43
public static void LogWarning ( string message )
34
44
{
35
- if ( enableLogging )
45
+ if ( IsLoggingEnabled )
36
46
Debug . LogWarning ( message ) ;
37
47
}
38
48
39
49
public static void LogError ( string message )
40
50
{
41
- //if(enableLogging )
51
+ //if(EnableLogging )
42
52
Debug . LogError ( message ) ;
43
53
}
44
54
}
You can’t perform that action at this time.
0 commit comments