Commits

Herbert Breunung committed f6bbba4

warnings now also appear in the IOUnit

Comments (0)

Files changed (2)

lib/Kephra/App/Panel/IOUnit.pm

 
 Kephra::CommandList::register_cmd_namespace('IOUnit');
 Kephra::CommandList::register_cmd({
-	'-focus' => { 
-		sub => 'focus_on_input',    label => ' ', keys => 'esc', 
-		help => ''},
+	'-focus' => { sub => 'focus_on_input',    label => ' ', keys => 'esc'},
 });
 
 
 	$self->{'active_slot_name'} = 'drum';
 	$self->{'process'} = '';
 
-	Wx::Event::EVT_SET_FOCUS($output_book, sub {$self->focus_on_input} );
-	$self->create_slot($_) for ($self->{'master_slot_name'}, qw/drum perl shell output log/);
+	$self->create_slot($_) for ($self->{'master_slot_name'}, qw/drum perl shell output log warn/);
 	$self->raise_slot( $self->{'active_slot_name'} );
 
+	Wx::Event::EVT_SET_FOCUS($output_book, sub {$self->focus_on_input} );
 	Wx::Event::EVT_NOTEBOOK_PAGE_CHANGED( $output_book, -1, sub {
 		my ($nb, $event ) = @_;
 		$self->{'active_slot_name'} = $nb->GetPageText( $event->GetSelection );

lib/Kephra/Log.pm

 use strict;
 use warnings;
+use Kephra::API;
 
 package Kephra::Log;
 
 
 sub init {}
 
-sub warning { warn timestamp(), ' ', (caller)[0], '::', $_[0] }
+sub warning { 
+	my $msg = timestamp().' '.(caller)[0].'::'. $_[0];
+	warn $msg;
+	Kephra::API::output('warn', $msg);
+}
 
 sub error { die timestamp(), ' ', (caller)[0], '::', $_[0] }