summaryrefslogtreecommitdiff
path: root/pandoc-emphasis
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2015-03-20 19:11:54 +0100
committerJonas Smedegaard <dr@jones.dk>2015-03-20 19:11:54 +0100
commit87737d0e578e551107e95d388121adf4d7b9eeeb (patch)
treec2202781035cbcc6ca605ef8647cded05aeafcc0 /pandoc-emphasis
parenta51581fe892440b0aa49116b449b108484a6104a (diff)
Use Log::Any (not Log::Contextual).
Diffstat (limited to 'pandoc-emphasis')
-rwxr-xr-xpandoc-emphasis21
1 files changed, 9 insertions, 12 deletions
diff --git a/pandoc-emphasis b/pandoc-emphasis
index 97ddac0..60c42d8 100755
--- a/pandoc-emphasis
+++ b/pandoc-emphasis
@@ -8,18 +8,12 @@ use Moops -strict;
use feature qw(switch);
no if $] >= 5.018, warnings => "experimental::smartmatch";
-use Log::Contextual::LogDispatchouli qw( :log set_logger );
-use Log::Dispatchouli;
use Pandoc::Filter 0.06;
use Pandoc::Elements;
-my $ld = Log::Dispatchouli->new({
- ident => 'pandoc-emphasis',
- to_stderr => 1,
- debug => ($ENV{PANDOC_DEBUG}),
- quiet_fatal => 'stdout',
-});
-set_logger $ld;
+use Log::Any qw($log);
+use Log::Any::Adapter ( 'ScreenColoredLevel',
+ use_color => ! -t *STDERR );
class Window {
use Pandoc::Filter;
@@ -89,14 +83,17 @@ sub emphasis {
if ( $window->peek_at_ledge() eq '"' ) {
$window->clear_ledge();
$title++;
- log_debug { 'emphasis →title: ' . $_ };
+ $log->infof( 'emphasis: %s+Emph→title: %s',
+ '"',
+ $_ );
return $window->interpret_view(
Quoted( DoubleQuote,
$self->content ));
}
}
when ( $self->content->[0]->name eq 'Quoted' ) {
- log_debug { 'emphasis →foreign: ' . $_ };
+ $log->infof( 'emphasis: Emph+Quoted→foreign: %s',
+ $_ );
# FIXME: LaTeX-encode text
return $window->interpret_view(
RawInline( 'latex',
@@ -118,7 +115,7 @@ sub emphasis {
}
$window->clear_ledge();
if ($title) {
- log_info { "emphasis odd after title markup." };
+ $log->warnf( "emphasis: odd title end markup." );
$title--;
}
return $window->describe_view();