From 29c75a45fa8fd5589cc34f7f2841cd163c56b160 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Sat, 16 Aug 2014 11:43:25 +0300 Subject: Closes #35 --- lib/oxidized/cli.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/oxidized/cli.rb b/lib/oxidized/cli.rb index d6a139d..c66ec8d 100644 --- a/lib/oxidized/cli.rb +++ b/lib/oxidized/cli.rb @@ -16,11 +16,13 @@ module Oxidized private def initialize + Log.info "Oxidized starting, running as pid #{$$}" _args, @opts = parse_opts CFG.debug = true if @opts[:debug] end def crash error + Log.fatal "Oxidized crashed, crashfile written in #{Config::Crash}" open Config::Crash, 'w' do |file| file.puts '-' * 50 file.puts Time.now.utc -- cgit v1.2.1 From b9db9a117daf3f1870e05906b9b05902d1f9b22e Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Sat, 16 Aug 2014 11:50:04 +0300 Subject: Closes #37 --- lib/oxidized/config.rb | 2 +- lib/oxidized/log.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/oxidized/config.rb b/lib/oxidized/config.rb index ddfde81..96c8fbf 100644 --- a/lib/oxidized/config.rb +++ b/lib/oxidized/config.rb @@ -51,6 +51,6 @@ module Oxidized Log.level = Logger::INFO unless CFG.debug raise NoConfig, 'edit ~/.config/oxidized/config' if CFGS.create - Log.file = CFG.log if CFG.log + Log.file = CFG.log if CFG.log end diff --git a/lib/oxidized/log.rb b/lib/oxidized/log.rb index 9e77646..e9ae1b4 100644 --- a/lib/oxidized/log.rb +++ b/lib/oxidized/log.rb @@ -12,6 +12,7 @@ module Oxidized super target end def file= target + FileUtils.mkdir_p File.dirname(target) @logdev = LogDevice.new target end end -- cgit v1.2.1 From 3ee2f961bc3cb615435e53d1c1f23838f9d4856f Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Sat, 16 Aug 2014 12:11:13 +0300 Subject: Closes #32 --- lib/oxidized/nodes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/oxidized/nodes.rb b/lib/oxidized/nodes.rb index d6cc867..6f30af4 100644 --- a/lib/oxidized/nodes.rb +++ b/lib/oxidized/nodes.rb @@ -28,6 +28,7 @@ module Oxidized Log.error "node %s is not resolvable, raised %s with message '%s'" % [node, err.class, err.message] end end + Log.info "Loaded #{size} nodes" size == 0 ? replace(new) : update_nodes(new) end end -- cgit v1.2.1