package Devel::ebug::Backend::Plugin::Output;
use strict;
use warnings;

my $stdout = "";
my $stderr = "";
close STDOUT;
open STDOUT, '>', \$stdout or die "Can't open STDOUT: $!";
close STDERR;
open STDERR, '>', \$stderr or die "Can't open STDOUT: $!";

sub register_commands {
  return (output => { sub => \&output });
}

sub output {
  my($req, $context) = @_;
  return {
    stdout => $stdout,
    stderr => $stderr,
  };
}
1;
