diff options
Diffstat (limited to 'pandoc-emphasis')
-rwxr-xr-x | pandoc-emphasis | 21 |
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(); |