From 608dc87f8f6ac2e9d2f37075d1db8bb2a45ebdeb Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 1 Oct 2012 20:34:28 +0000 Subject: Merge in patches from asteria git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@554 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- nsa | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'nsa') diff --git a/nsa b/nsa index 95839db..99789bc 100755 --- a/nsa +++ b/nsa @@ -26,6 +26,11 @@ require 'openssl' require 'yaml' require 'monitor' +if RUBY_VERSION =~ /1.9/ + Encoding.default_external = Encoding::UTF_8 + Encoding.default_internal = Encoding::UTF_8 +end + default_irc = { 'server' => 'irc.oftc.net', 'port' => 6667, @@ -45,13 +50,13 @@ class << Log def init @ignore_list = [] @ignore_list << "dispatch thread" - @ignore_list << "connection" + #@ignore_list << "connection" @ignore_list << "waituntilonline - waiter" @ignore_list << "waituntilonline - runthread" end def log section, message - puts message unless @ignore_list.include?(section) + puts "[#{Time.now}] #{message}" unless @ignore_list.include?(section) end end @@ -126,8 +131,8 @@ class Connection @outQueue.synchronize do @outEmpty.wait_while { @outQueue.empty? } line = @outQueue.shift - @sock.puts line Log.log "connection", "[connection] >>> " + line + @sock.puts line end end rescue => e -- cgit v1.2.3