fig 1.17.0 → 1.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changes +9 -0
- data/lib/fig.rb +1 -1
- data/lib/fig/command.rb +4 -1
- data/lib/fig/command/options.rb +13 -0
- data/lib/fig/command/options/parser.rb +1 -1
- data/lib/fig/logging.rb +13 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7fb3073d76f5c0d7cbd185a72f45ba89f871298
|
4
|
+
data.tar.gz: de9a393a476bf59a2ab1326d1783f8cf7fe20ad8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36ce73abd3571db773da546054a36a612e29f57976f6aa2bccec0010c4c53ff5a57e51e9a271ba7958b247316fb0eec5db98ceabc63b2cc7e8a534b2e5fd1c71
|
7
|
+
data.tar.gz: 5ff243dc821b138dae732e3d77e67e60b85780519396b239666548cc59575780cf2a11522b52dcc773f164a7a5d9ea4b0ace72c20e50960b5285f545186f4f49
|
data/Changes
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
v1.18.0 - 2014/7/1
|
2
|
+
|
3
|
+
New features:
|
4
|
+
|
5
|
+
- New --log-to-stdout option that, surprise, sends log output to standard
|
6
|
+
output instead of standard error. Can't be used with --log-config, but,
|
7
|
+
then, you can get log output to go whereever you want with a configuration
|
8
|
+
file. ;]
|
9
|
+
|
1
10
|
v1.17.0 - 2014/5/5
|
2
11
|
|
3
12
|
Miscellaneous:
|
data/lib/fig.rb
CHANGED
data/lib/fig/command.rb
CHANGED
@@ -39,7 +39,9 @@ class Fig::Command
|
|
39
39
|
return @options.exit_code
|
40
40
|
end
|
41
41
|
|
42
|
-
Fig::Logging.initialize_pre_configuration(
|
42
|
+
Fig::Logging.initialize_pre_configuration(
|
43
|
+
@options.log_to_stdout(), @options.log_level(),
|
44
|
+
)
|
43
45
|
|
44
46
|
actions = @options.actions()
|
45
47
|
if actions.empty?
|
@@ -189,6 +191,7 @@ class Fig::Command
|
|
189
191
|
|
190
192
|
Fig::Logging.initialize_post_configuration(
|
191
193
|
@options.log_config() || @application_configuration['log configuration'],
|
194
|
+
@options.log_to_stdout(),
|
192
195
|
@options.log_level()
|
193
196
|
)
|
194
197
|
|
data/lib/fig/command/options.rb
CHANGED
@@ -57,6 +57,7 @@ class Fig::Command::Options
|
|
57
57
|
attr_reader :file_to_find_package_for
|
58
58
|
attr_reader :home
|
59
59
|
attr_reader :log_config
|
60
|
+
attr_reader :log_to_stdout
|
60
61
|
attr_reader :log_level
|
61
62
|
attr_reader :package_definition_file
|
62
63
|
attr_reader :parser
|
@@ -630,6 +631,12 @@ class Fig::Command::Options
|
|
630
631
|
@log_config = path
|
631
632
|
end
|
632
633
|
|
634
|
+
@parser.on(
|
635
|
+
'--log-to-stdout', 'write log output to stdout instead of stderr',
|
636
|
+
) do
|
637
|
+
@log_to_stdout = true
|
638
|
+
end
|
639
|
+
|
633
640
|
level_list = LOG_LEVELS.join(', ')
|
634
641
|
@parser.on(
|
635
642
|
'--log-level LEVEL',
|
@@ -807,6 +814,12 @@ class Fig::Command::Options
|
|
807
814
|
)
|
808
815
|
end
|
809
816
|
|
817
|
+
if @log_to_stdout && @log_config
|
818
|
+
raise Fig::Command::OptionError.new(
|
819
|
+
'Cannot use --log-to-stdout and --log-config at the same time.'
|
820
|
+
)
|
821
|
+
end
|
822
|
+
|
810
823
|
return
|
811
824
|
end
|
812
825
|
|
@@ -92,7 +92,7 @@ Standard options (represented as "[...]" above):
|
|
92
92
|
|
93
93
|
[-l | --login]
|
94
94
|
|
95
|
-
[--log-level LEVEL] [--log-config PATH]
|
95
|
+
[--log-level LEVEL] [--log-config PATH | --log-to-stdout]
|
96
96
|
[--figrc PATH] [--no-figrc]
|
97
97
|
|
98
98
|
[--suppress-vcs-comments-in-published-packages]
|
data/lib/fig/logging.rb
CHANGED
@@ -25,16 +25,17 @@ module Fig::Logging
|
|
25
25
|
'all' => Log4r::ALL
|
26
26
|
}
|
27
27
|
|
28
|
-
def self.initialize_pre_configuration(log_level
|
28
|
+
def self.initialize_pre_configuration(log_to_stdout, log_level)
|
29
29
|
log_level ||= 'info'
|
30
30
|
|
31
31
|
assign_log_level(@@logger, log_level)
|
32
|
-
setup_default_outputter(@@logger)
|
32
|
+
setup_default_outputter(@@logger, log_to_stdout)
|
33
33
|
end
|
34
34
|
|
35
35
|
def self.initialize_post_configuration(
|
36
|
-
config_file
|
37
|
-
|
36
|
+
config_file,
|
37
|
+
log_to_stdout,
|
38
|
+
log_level,
|
38
39
|
suppress_default_configuration = false
|
39
40
|
)
|
40
41
|
if config_file
|
@@ -64,7 +65,7 @@ module Fig::Logging
|
|
64
65
|
|
65
66
|
if not config_file and not suppress_default_configuration
|
66
67
|
assign_log_level(@@logger, 'info')
|
67
|
-
setup_default_outputter(@@logger)
|
68
|
+
setup_default_outputter(@@logger, log_to_stdout)
|
68
69
|
end
|
69
70
|
|
70
71
|
assign_log_level(@@logger, log_level)
|
@@ -124,8 +125,13 @@ module Fig::Logging
|
|
124
125
|
return
|
125
126
|
end
|
126
127
|
|
127
|
-
def self.setup_default_outputter(logger)
|
128
|
-
|
128
|
+
def self.setup_default_outputter(logger, log_to_stdout)
|
129
|
+
if log_to_stdout
|
130
|
+
outputter = Fig::Log4r::Outputter.new('fig stdout', $stdout)
|
131
|
+
else
|
132
|
+
outputter = Fig::Log4r::Outputter.new('fig stderr', $stderr)
|
133
|
+
end
|
134
|
+
|
129
135
|
logger.add outputter
|
130
136
|
outputter.formatter = Log4r::PatternFormatter.new :pattern => '%M'
|
131
137
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Foemmel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|