File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,16 @@ def _select_pal(dict_):
10
10
fail ("Missing key for executorch.pal_default value '{}' in dict '{}'" .format (pal_default , dict_ ))
11
11
return dict_ [pal_default ]
12
12
13
+ def logging_enabled ():
14
+ return native .read_config ("executorch" , "enable_et_log" , "true" ) == "true"
15
+
16
+ def get_logging_flags ():
17
+ if logging_enabled ():
18
+ # On by default.
19
+ return []
20
+ else :
21
+ return ["-DET_LOG_ENABLED=0" ]
22
+
13
23
def profiling_enabled ():
14
24
return native .read_config ("executorch" , "prof_enabled" , "false" ) == "true"
15
25
@@ -57,9 +67,6 @@ def define_common_targets():
57
67
force_static = True ,
58
68
)
59
69
60
- # Enable or disable ET_LOGs
61
- enable_et_log = native .read_config ("executorch" , "enable_et_log" , None )
62
-
63
70
# Interfaces for executorch users
64
71
runtime .cxx_library (
65
72
name = "platform" ,
@@ -77,7 +84,7 @@ def define_common_targets():
77
84
"profiler.cpp" ,
78
85
"runtime.cpp" ,
79
86
],
80
- exported_preprocessor_flags = get_profiling_flags () + ([ "-DET_LOG_ENABLED=0" ] if enable_et_log else [] ),
87
+ exported_preprocessor_flags = get_profiling_flags () + get_logging_flags ( ),
81
88
exported_deps = [
82
89
"//executorch/runtime/platform:pal_interface" ,
83
90
":compiler" ,
You can’t perform that action at this time.
0 commit comments