Skip to content

Commit

Permalink
Merge pull request #776 from robertpanzer/jruby-9260
Browse files Browse the repository at this point in the history
Upgrade JRuby to 9.2.6.0
  • Loading branch information
robertpanzer authored Feb 21, 2019
2 parents cf34fb8 + c52f901 commit 9701649
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.jruby.runtime.builtin.IRubyObject;

import java.util.Objects;
import java.util.Optional;

public class JavaLogger extends RubyObject {

Expand Down Expand Up @@ -94,10 +95,12 @@ private LogRecord createLogRecord(final ThreadContext threadContext,
final Severity severity,
final Cursor cursor,
final String message) {
BacktraceElement[] backtrace = threadContext.getBacktrace();
final String sourceFileName = backtrace[2].getFilename();
final String sourceMethodName = backtrace[2].getMethod();
final LogRecord record = new LogRecord(severity, cursor, message, sourceFileName, sourceMethodName);
final Optional<BacktraceElement> elem = threadContext.getBacktrace(0)
.skip(1)
.findFirst();

final String sourceFileName = elem.map(BacktraceElement::getFilename).orElse(null);
final String sourceMethodName = elem.map(BacktraceElement::getMethod).orElse(null); final LogRecord record = new LogRecord(severity, cursor, message, sourceFileName, sourceMethodName);
return record;
}

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ext {
guavaVersion = '18.0'
hamcrestVersion = '1.3'
jcommanderVersion = '1.35'
jrubyVersion = '9.2.5.0'
jrubyVersion = '9.2.6.0'
jsoupVersion = '1.10.2'
junitVersion = '4.12'
nettyVersion = '4.0.33.Final'
Expand Down

0 comments on commit 9701649

Please sign in to comment.