13
13
*/
14
14
15
15
16
- #include " rust_log.h"
17
16
#include " rust_crate_map.h"
18
17
#include " util/array_list.h"
19
18
#include " rust_util.h"
@@ -25,6 +24,12 @@ struct log_directive {
25
24
size_t level;
26
25
};
27
26
27
+
28
+ const uint32_t log_err = 1 ;
29
+ const uint32_t log_warn = 2 ;
30
+ const uint32_t log_info = 3 ;
31
+ const uint32_t log_debug = 4 ;
32
+
28
33
const size_t max_log_directives = 255 ;
29
34
const size_t max_log_level = 255 ;
30
35
const size_t default_log_level = log_err;
@@ -84,12 +89,6 @@ static void update_entry(const mod_entry* entry, void *cookie) {
84
89
}
85
90
}
86
91
87
- void update_module_map (const mod_entry* map, log_directive* dirs,
88
- size_t n_dirs, size_t *n_matches) {
89
- update_entry_args args = { dirs, n_dirs, n_matches };
90
- iter_module_map (map, update_entry, &args);
91
- }
92
-
93
92
void update_crate_map (const cratemap* map, log_directive* dirs,
94
93
size_t n_dirs, size_t *n_matches) {
95
94
update_entry_args args = { dirs, n_dirs, n_matches };
@@ -104,40 +103,6 @@ void print_crate_log_map(const cratemap* map) {
104
103
iter_crate_map (map, print_mod_name, NULL );
105
104
}
106
105
107
- // These are pseudo-modules used to control logging in the runtime.
108
-
109
- uint32_t log_rt_mem;
110
- uint32_t log_rt_box;
111
- uint32_t log_rt_comm;
112
- uint32_t log_rt_task;
113
- uint32_t log_rt_dom;
114
- uint32_t log_rt_trace;
115
- uint32_t log_rt_cache;
116
- uint32_t log_rt_upcall;
117
- uint32_t log_rt_timer;
118
- uint32_t log_rt_gc;
119
- uint32_t log_rt_stdlib;
120
- uint32_t log_rt_kern;
121
- uint32_t log_rt_backtrace;
122
- uint32_t log_rt_callback;
123
-
124
- static const mod_entry _rt_module_map[] =
125
- {{" ::rt::mem" , &log_rt_mem},
126
- {" ::rt::box" , &log_rt_box},
127
- {" ::rt::comm" , &log_rt_comm},
128
- {" ::rt::task" , &log_rt_task},
129
- {" ::rt::dom" , &log_rt_dom},
130
- {" ::rt::trace" , &log_rt_trace},
131
- {" ::rt::cache" , &log_rt_cache},
132
- {" ::rt::upcall" , &log_rt_upcall},
133
- {" ::rt::timer" , &log_rt_timer},
134
- {" ::rt::gc" , &log_rt_gc},
135
- {" ::rt::stdlib" , &log_rt_stdlib},
136
- {" ::rt::kern" , &log_rt_kern},
137
- {" ::rt::backtrace" , &log_rt_backtrace},
138
- {" ::rt::callback" , &log_rt_callback},
139
- {NULL , NULL }};
140
-
141
106
void update_log_settings (void * crate_map, char * settings) {
142
107
char * buffer = NULL ;
143
108
log_directive dirs[256 ];
@@ -160,7 +125,6 @@ void update_log_settings(void* crate_map, char* settings) {
160
125
}
161
126
162
127
size_t n_matches = 0 ;
163
- update_module_map (_rt_module_map, &dirs[0 ], n_dirs, &n_matches);
164
128
update_crate_map ((const cratemap*)crate_map, &dirs[0 ],
165
129
n_dirs, &n_matches);
166
130
0 commit comments