diff options
author | Peter Palfrader <peter@palfrader.org> | 2012-10-01 20:34:28 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2012-10-01 20:34:28 +0000 |
commit | 608dc87f8f6ac2e9d2f37075d1db8bb2a45ebdeb (patch) | |
tree | 10b6800fd4bc9b14a581f2d2772c517a8667f0a1 /nsa | |
parent | f36d4603b8b1aa9a8baeb8555719fb441f02851c (diff) |
Merge in patches from asteria
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@554 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'nsa')
-rwxr-xr-x | nsa | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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 |