rt: Remove unused parts of rust_log

This commit is contained in:
Brian Anderson 2013-08-09 23:15:19 -07:00
parent 085dc55e13
commit cb89afc64e
2 changed files with 6 additions and 80 deletions

View File

@ -13,7 +13,6 @@
*/
#include "rust_log.h"
#include "rust_crate_map.h"
#include "util/array_list.h"
#include "rust_util.h"
@ -25,6 +24,12 @@ struct log_directive {
size_t level;
};
const uint32_t log_err = 1;
const uint32_t log_warn = 2;
const uint32_t log_info = 3;
const uint32_t log_debug = 4;
const size_t max_log_directives = 255;
const size_t max_log_level = 255;
const size_t default_log_level = log_err;
@ -84,12 +89,6 @@ static void update_entry(const mod_entry* entry, void *cookie) {
}
}
void update_module_map(const mod_entry* map, log_directive* dirs,
size_t n_dirs, size_t *n_matches) {
update_entry_args args = { dirs, n_dirs, n_matches };
iter_module_map(map, update_entry, &args);
}
void update_crate_map(const cratemap* map, log_directive* dirs,
size_t n_dirs, size_t *n_matches) {
update_entry_args args = { dirs, n_dirs, n_matches };
@ -104,40 +103,6 @@ void print_crate_log_map(const cratemap* map) {
iter_crate_map(map, print_mod_name, NULL);
}
// These are pseudo-modules used to control logging in the runtime.
uint32_t log_rt_mem;
uint32_t log_rt_box;
uint32_t log_rt_comm;
uint32_t log_rt_task;
uint32_t log_rt_dom;
uint32_t log_rt_trace;
uint32_t log_rt_cache;
uint32_t log_rt_upcall;
uint32_t log_rt_timer;
uint32_t log_rt_gc;
uint32_t log_rt_stdlib;
uint32_t log_rt_kern;
uint32_t log_rt_backtrace;
uint32_t log_rt_callback;
static const mod_entry _rt_module_map[] =
{{"::rt::mem", &log_rt_mem},
{"::rt::box", &log_rt_box},
{"::rt::comm", &log_rt_comm},
{"::rt::task", &log_rt_task},
{"::rt::dom", &log_rt_dom},
{"::rt::trace", &log_rt_trace},
{"::rt::cache", &log_rt_cache},
{"::rt::upcall", &log_rt_upcall},
{"::rt::timer", &log_rt_timer},
{"::rt::gc", &log_rt_gc},
{"::rt::stdlib", &log_rt_stdlib},
{"::rt::kern", &log_rt_kern},
{"::rt::backtrace", &log_rt_backtrace},
{"::rt::callback", &log_rt_callback},
{NULL, NULL}};
void update_log_settings(void* crate_map, char* settings) {
char* buffer = NULL;
log_directive dirs[256];
@ -160,7 +125,6 @@ void update_log_settings(void* crate_map, char* settings) {
}
size_t n_matches = 0;
update_module_map(_rt_module_map, &dirs[0], n_dirs, &n_matches);
update_crate_map((const cratemap*)crate_map, &dirs[0],
n_dirs, &n_matches);

View File

@ -1,38 +0,0 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#ifndef RUST_LOG_H
#define RUST_LOG_H
#include "rust_globals.h"
const uint32_t log_err = 1;
const uint32_t log_warn = 2;
const uint32_t log_info = 3;
const uint32_t log_debug = 4;
void update_log_settings(void* crate_map, char* settings);
extern uint32_t log_rt_mem;
extern uint32_t log_rt_box;
extern uint32_t log_rt_comm;
extern uint32_t log_rt_task;
extern uint32_t log_rt_dom;
extern uint32_t log_rt_trace;
extern uint32_t log_rt_cache;
extern uint32_t log_rt_upcall;
extern uint32_t log_rt_timer;
extern uint32_t log_rt_gc;
extern uint32_t log_rt_stdlib;
extern uint32_t log_rt_kern;
extern uint32_t log_rt_backtrace;
extern uint32_t log_rt_callback;
#endif /* RUST_LOG_H */