Skip to content

Commit b913547

Browse files
toddaarobrson
authored andcommitted
modified logging function to truncate output and adjusted error output formatting tests to be compatible with both the new and old runtimes
1 parent efd6eaf commit b913547

9 files changed

+18
-8
lines changed

src/libstd/logging.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,16 @@ pub fn log_type<T>(level: u32, object: &T) {
8585
fn newsched_log_str(msg: ~str) {
8686
use rt::task::Task;
8787
use rt::local::Local;
88+
use str::StrSlice;
89+
use container::Container;
90+
91+
// Truncate the string
92+
let buf_bytes = 2048;
93+
let msg = if msg.len() > buf_bytes {
94+
msg.slice(0, buf_bytes) + "[...]"
95+
} else {
96+
msg
97+
};
8898

8999
unsafe {
90100
match Local::try_unsafe_borrow::<Task>() {

src/test/run-fail/assert-macro-explicit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:task failed at 'assertion failed: false'
11+
// error-pattern:failed at 'assertion failed: false'
1212

1313
fn main() {
1414
assert!(false);

src/test/run-fail/assert-macro-fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:task failed at 'test-assert-fmt 42 rust'
11+
// error-pattern:failed at 'test-assert-fmt 42 rust'
1212

1313
fn main() {
1414
assert!(false, "test-assert-fmt %d %s", 42, "rust");

src/test/run-fail/assert-macro-owned.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:task failed at 'test-assert-owned'
11+
// error-pattern:failed at 'test-assert-owned'
1212

1313
fn main() {
1414
assert!(false, ~"test-assert-owned");

src/test/run-fail/assert-macro-static.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:task failed at 'test-assert-static'
11+
// error-pattern:failed at 'test-assert-static'
1212

1313
fn main() {
1414
assert!(false, "test-assert-static");

src/test/run-fail/fail-macro-explicit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:task failed at 'explicit failure'
11+
// error-pattern:failed at 'explicit failure'
1212

1313
fn main() {
1414
fail!();

src/test/run-fail/fail-macro-fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:task failed at 'test-fail-fmt 42 rust'
11+
// error-pattern:failed at 'test-fail-fmt 42 rust'
1212

1313
fn main() {
1414
fail!("test-fail-fmt %d %s", 42, "rust");

src/test/run-fail/fail-macro-owned.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:task failed at 'test-fail-owned'
11+
// error-pattern:failed at 'test-fail-owned'
1212

1313
fn main() {
1414
fail!("test-fail-owned");

src/test/run-fail/fail-macro-static.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:task failed at 'test-fail-static'
11+
// error-pattern:failed at 'test-fail-static'
1212

1313
fn main() {
1414
fail!("test-fail-static");

0 commit comments

Comments
 (0)