32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# File 'lib/fluent/diagtool/windows/diagutils.rb', line 32
def run_diagtool()
@conf[:time] = @time_format
@conf[:workdir] = @conf[:basedir] + '/' + @time_format
@conf[:outdir] = @conf[:workdir] + '/output'
FileUtils.mkdir_p(@conf[:workdir])
FileUtils.mkdir_p(@conf[:outdir])
diaglog = @conf[:workdir] + '/diagtool.output'
@logger = Logger.new(STDOUT, formatter: proc {|severity, datetime, progname, msg|
"#{datetime}: [Diagtool] [#{severity}] #{msg}\n"
})
@logger_file = Logger.new(diaglog, formatter: proc {|severity, datetime, progname, msg|
"#{datetime}: [Diagtool] [#{severity}] #{msg}\n"
})
diaglogger_info("Parsing command options...")
diaglogger_info(" Option : Output directory = #{@conf[:basedir]}")
loglevel = 'WARN'
diaglogger_info("Initializing parameters...")
c = CollectUtils.new(@conf, loglevel)
diaglogger_info("[Collect] Collecting #{@conf[:package_name]} gem information...")
tdgem = c.collect_tdgems()
diaglogger_info("[Collect] #{@conf[:package_name]} gem information is stored in #{tdgem}")
gem_info = c.collect_manually_installed_gems(tdgem)
diaglogger_info("[Collect] #{@conf[:package_name]} gem information (bundled by default) is stored in #{gem_info[:bundled]}")
diaglogger_info("[Collect] #{@conf[:package_name]} manually installed gem information is stored in #{gem_info[:local]}")
local_gems = File.read(gem_info[:local]).lines(chomp: true)
unless local_gems == [""]
diaglogger_info("[Collect] #{@conf[:package_name]} manually installed gems:")
local_gems.each do |gem|
diaglogger_info("[Collect] * #{gem}")
end
end
end
|