<div dir="ltr"><p style="box-sizing:border-box;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:14px;margin-top:0px">Hello Dancers,</p><p style="box-sizing:border-box;margin-bottom:16px;margin-top:0px"><font color="#333333" face="-apple-system, blinkmacsystemfont, segoe ui, helvetica, arial, sans-serif, apple color emoji, segoe ui emoji, segoe ui symbol"><span style="font-size:14px">What's the recommended procedure for converting a plugin that may import an unspecified number of keywords into the app? I use </span></font><a href="https://github.com/wchristian/Dancer2-Plugin-LogContextual" style="color:rgb(64,120,192);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:14px;box-sizing:border-box;background-color:transparent;text-decoration:none">Dancer2::Plugin::LogContextual</a><font color="#333333" face="-apple-system, blinkmacsystemfont, segoe ui, helvetica, arial, sans-serif, apple color emoji, segoe ui emoji, segoe ui symbol"><span style="font-size:14px">, which imports a set of keywords via </span></font><code style="color:rgb(51,51,51);font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:11.899999618530273px;box-sizing:border-box;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">use Log::Contextual ':log'</code><font color="#333333" face="-apple-system, blinkmacsystemfont, segoe ui, helvetica, arial, sans-serif, apple color emoji, segoe ui emoji, segoe ui symbol"><span style="font-size:14px"> and redefines </span></font><code style="color:rgb(51,51,51);font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:11.899999618530273px;box-sizing:border-box;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">$SIG{__WARN__}</code><font color="#333333" face="-apple-system, blinkmacsystemfont, segoe ui, helvetica, arial, sans-serif, apple color emoji, segoe ui emoji, segoe ui symbol"><span style="font-size:14px"> for the application by adding an </span></font><code style="color:rgb(51,51,51);font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:11.899999618530273px;box-sizing:border-box;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">around</code> <font color="#333333" face="-apple-system, blinkmacsystemfont, segoe ui, helvetica, arial, sans-serif, apple color emoji, segoe ui emoji, segoe ui symbol"><span style="font-size:14px">method modifier to </span></font><code style="color:rgb(51,51,51);font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:11.899999618530273px;box-sizing:border-box;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">to_app</code>.<span style="color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:14px"> </span><span style="color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:14px">I'm </span><font color="#333333" face="-apple-system, blinkmacsystemfont, segoe ui, helvetica, arial, sans-serif, apple color emoji, segoe ui emoji, segoe ui symbol"><span style="font-size:14px">unsure of the best way to handle this with the new plugin system (I am not the plugin author).</span></font></p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:14px">A sample of the plugin code:</p><pre style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:11.899999618530273px;margin-top:0px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;color:rgb(51,51,51);margin-bottom:0px"><code style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;padding:0px;margin:0px;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal">around to_app => sub {
my ( $attr, $self, @args ) = @_;
my $app = $self->$attr( @args );
return sub {
local $SIG{__WARN__} = sub {
my @args = @_;
log_warn { @args };
};
return $app->( @_ );
};
};</code></pre><br><br><div>Any hints gratefully received. Thanks!</div></div>