in reply to Net::Appliance::Session is sending too much output to the screen

hello tired_baboon and welcome to (active life in) the monaastery!

i've zero experience with such things but if i read correctly the docs $s->set_global_log_at is to turn on debug.

In the same paragraph it is stated that $s->nci->logger is coming from Net::CLI::Interact::Logger and i suppose it is on that logger that you have to work to leverage the output. The doces says: "This module implements a generic logging service, based on Log::Dispatch but with additional options and configuration." so for a full understand you need to read also what Log::Dispatch does.

This is the default configuration of the logger:

# log_config( \%config ) ... { dispatchers => ['screen'], screen => { class => 'Log::Dispatch::Screen', min_level => 'debug', }, };
So it seems you need to try different values for the min_level key.

HtH

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: Net::Appliance::Session is sending too much output to the screen
by tired_baboon (Initiate) on Mar 03, 2016 at 16:07 UTC

    Okay, so I attempted to navigate Net::CLI::Interact::Logger, and tried a few things, but no luck. I think I'm doing this right, but it doesn't seem to make any difference, and I'm still getting the same output.

    I slipped this snippet in immediately after my session declaration.

    $s->nci->logger->log_config({ dispatchers => ['screen'], screen => { class => 'Log::Dispatch::Screen', min_level => 'error' } });

    I also attempted another route, thinking I was attacking it at a deeper level, but it didn't do any good either

    use Log::Dispatch::Screen; my $log = Log::Dispatch->new(); $log->add( Log::Dispatch::Screen->new( name => 'screen', min_level => 'error' ) );
      okay i for sure not the best help for you.. i cannot reproduce your code nor your errors.. i just told you what i saw in the docs.

      Anyway the output you posted seems to me a dump of the Net::CLI::Interact::ActionSet that are Moo::Object stuffs. It is this the only unwanted output you get? the rest of the output is what do you expect? if you leverage the logger the otput change somehow?

      L*

      There are no rules, there are no thumbs..
      Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.