stack-kicker 0.0.20 → 0.0.21

Sign up to get free protection for your applications and to get access to all the features.
data/bin/stack-kicker CHANGED
@@ -28,7 +28,17 @@ class App
28
28
  include Methadone::CLILogging
29
29
 
30
30
  main do |task|
31
+ # set the formatter
32
+ case options['log-format']
33
+ when :simple
34
+ format = Proc.new { |severity, datetime, progname, msg| "#{msg}\n" }
35
+ else
36
+ format = Proc.new { |severity, datetime, progname, msg| "#{datetime} #{severity}: #{msg}\n" }
37
+ end
38
+ Stack.log_format(format)
39
+
31
40
  debug { "options = #{options}" }
41
+
32
42
  # pass the logger.level into the Stack module
33
43
  Stack.log_level(logger.level)
34
44
 
@@ -90,6 +100,11 @@ class App
90
100
  on("--ssh-command \"do/something\"", "Command to be run over ssh")
91
101
  on("--skip-secgroup-sync-deletes", "Skip deletes during secgroup-sync, handy for running multiple stacks in the one account with overlapping group names")
92
102
 
103
+ options['log-format'] = :default
104
+ opts.on("-f", "--log-format FMT", [:default, :simple], "sets the log formatter (simple=msg, default=datetime severity msg") do |f|
105
+ options['log-format'] = f
106
+ end
107
+
93
108
  arg :task, "task to be performed validate|configure-knife|show-stacks|show-stack|show-running|build|replace|delete|secgroup-sync|ssh"
94
109
  version Stack::Kicker::VERSION
95
110
 
@@ -1,5 +1,5 @@
1
1
  module Stack
2
2
  module Kicker
3
- VERSION = "0.0.20"
3
+ VERSION = "0.0.21"
4
4
  end
5
5
  end
data/lib/stack.rb CHANGED
@@ -52,6 +52,10 @@ module Stack
52
52
  Logger.level = level
53
53
  end
54
54
 
55
+ def Stack.log_format(format_proc)
56
+ Logger.formatter = format_proc
57
+ end
58
+
55
59
  def Stack.show_stacks(stackfile = 'Stackfile')
56
60
  # our local config file
57
61
  config_raw = File.read(stackfile)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stack-kicker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-17 00:00:00.000000000 Z
12
+ date: 2013-06-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdoc