Skip to content

Commit 7517b82

Browse files
committed
Copy state on clone/dup in initialize_copy
1 parent 44b34c2 commit 7517b82

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main/java/org/jruby/rack/ext/Logger.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,18 @@ else if ( context instanceof RackContext ) {
117117
}
118118
}
119119

120+
@JRubyMethod
121+
public IRubyObject initialize_copy(final ThreadContext context, final IRubyObject logger) {
122+
Logger other = (Logger) logger;
123+
124+
this.level = other.level;
125+
this.logger = other.logger;
126+
this.formatter = other.formatter;
127+
this.progname = other.progname;
128+
129+
return this;
130+
}
131+
120132
@JRubyMethod
121133
public IRubyObject real_logger(final ThreadContext context) {
122134
return JavaEmbedUtils.javaToRuby(context.runtime, logger);

0 commit comments

Comments
 (0)