Skip to content

Commit cb89afc

Browse files
committed
rt: Remove unused parts of rust_log
1 parent 085dc55 commit cb89afc

File tree

2 files changed

+6
-80
lines changed

2 files changed

+6
-80
lines changed

src/rt/rust_log.cpp

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*/
1414

1515

16-
#include "rust_log.h"
1716
#include "rust_crate_map.h"
1817
#include "util/array_list.h"
1918
#include "rust_util.h"
@@ -25,6 +24,12 @@ struct log_directive {
2524
size_t level;
2625
};
2726

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+
2833
const size_t max_log_directives = 255;
2934
const size_t max_log_level = 255;
3035
const size_t default_log_level = log_err;
@@ -84,12 +89,6 @@ static void update_entry(const mod_entry* entry, void *cookie) {
8489
}
8590
}
8691

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-
9392
void update_crate_map(const cratemap* map, log_directive* dirs,
9493
size_t n_dirs, size_t *n_matches) {
9594
update_entry_args args = { dirs, n_dirs, n_matches };
@@ -104,40 +103,6 @@ void print_crate_log_map(const cratemap* map) {
104103
iter_crate_map(map, print_mod_name, NULL);
105104
}
106105

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-
141106
void update_log_settings(void* crate_map, char* settings) {
142107
char* buffer = NULL;
143108
log_directive dirs[256];
@@ -160,7 +125,6 @@ void update_log_settings(void* crate_map, char* settings) {
160125
}
161126

162127
size_t n_matches = 0;
163-
update_module_map(_rt_module_map, &dirs[0], n_dirs, &n_matches);
164128
update_crate_map((const cratemap*)crate_map, &dirs[0],
165129
n_dirs, &n_matches);
166130

src/rt/rust_log.h

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)