ruby_ami noisy on Stream close.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ruby_ami noisy on Stream close.

Steve Sether
I'm using ruby_ami as an API for some command line utilities for Asterisk.  It works well, but I've found it's very noisy when the program exits.  Essentially I'm creating a new stream object, sending an action, and getting and parsing the results.  Then the program exits.  Before the program exits I get this on my console:

D, [2017-08-07T11:12:17.874599 #5839] DEBUG -- : Terminating 1 actor...
W, [2017-08-07T11:12:17.875207 #5839]  WARN -- : Terminating task: type=:call, meta={:method_name=>:run}, status=:iowait


I've traced this down to Celluloid being noisy, and can silence this by simply doing:


Celluloid.logger.sev_threshold = Logger::FATAL

So that's OK for now, but it seems like there should be a better way.  I first started looking for a way of better closing the AMI connection to avoid having my resources be managed by something else.  I didn't see that anywhere, so I had to dig into some internals and finally found the Celluloid component and then the logger.

Is there a better way to handle this than simply changing the log level?  I think it's much more useful to shut down the AMI connection on my own (and thus avoid this whole problem), but I didn't see that anywhere in the documentation, or public methods.  If there isn't, I think there should be.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.