Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d9d8b4c

Browse files
committedJun 20, 2015
Merge remote-tracking branch 'origin' into 1.8.7
2 parents 8edd7cf + 915978c commit d9d8b4c

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed
 

Diff for: ‎vm/environment.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,9 @@ namespace rubinius {
132132
}
133133

134134
void cpp_exception_bug() {
135-
std::cerr << "[BUG] Uncaught C++ internal exception\n";
136-
std::cerr << "So sorry, it appears that you've encountered an internal\n";
137-
std::cerr << "bug. Please report this on the rubinius issue tracker.\n";
138-
std::cerr << "Include the following backtrace in the issue:\n\n";
135+
utilities::logger::fatal("[BUG: Uncaught C++ exception]");
136+
utilities::logger::fatal("Please report this with the following backtrace to " \
137+
"https://github.com/rubinius/rubinius/issues");
139138

140139
rubinius::abort();
141140
}
@@ -579,6 +578,8 @@ namespace rubinius {
579578
void Environment::halt(STATE) {
580579
utilities::thread::Mutex::LockGuard guard(halt_lock_);
581580

581+
utilities::logger::write("exiting: %s %d", shared->pid.c_str(), exit_code(state));
582+
582583
state->shared().tool_broker()->shutdown(state);
583584

584585
if(ObjectMemory* om = state->memory()) {

Diff for: ‎vm/exception.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -117,26 +117,25 @@ namespace rubinius {
117117
}
118118

119119
void abort() {
120-
std::cout << "Abort!" << std::endl;
120+
utilities::logger::fatal("The Rubinius process is aborting");
121121
print_backtrace();
122122
::abort();
123123
}
124124

125125
void bug(const char* message) {
126-
std::cerr << "[BUG: " << message << "]\n";
126+
utilities::logger::fatal("[BUG: %s]", message);
127127
print_backtrace();
128128
::abort();
129129
}
130130

131131
void bug(const char* message, const char* arg) {
132-
std::cerr << "[BUG: " << message
133-
<< ": " << arg
134-
<< "]\n";
132+
utilities::logger::fatal("[BUG: %s: %s]", message, arg);
135133
print_backtrace();
136134
::abort();
137135
}
138136

139137
void warn(const char* message) {
138+
utilities::logger::warn("[WARNING: %s]", message);
140139
std::cerr << "[WARNING: " << message << "]\n";
141140
print_backtrace();
142141
}
@@ -146,6 +145,7 @@ namespace rubinius {
146145
demangle(s);
147146

148147
for(size_t i = 0; i < s.size(); i++) {
148+
utilities::logger::warn("%s", s[i].c_str());
149149
std::cout << s[i] << std::endl;
150150
}
151151
}
@@ -185,6 +185,7 @@ namespace rubinius {
185185
if(!backtrace) return;
186186

187187
for(size_t i = 0; i < backtrace->size(); i++) {
188+
utilities::logger::warn("%s", backtrace->at(i).c_str());
188189
std::cout << backtrace->at(i) << std::endl;
189190
}
190191
}

0 commit comments

Comments
 (0)
Please sign in to comment.