share/rbbt_commands/workflow/info in rbbt-util-5.13.37 vs share/rbbt_commands/workflow/info in rbbt-util-5.14.0
- old
+ new
@@ -12,15 +12,17 @@
Examine the info of a job result
$ rbbt workflow info <job-result>
-h--help Help
+-a--all Print all info entries
EOF
SOPT.usage if options[:help]
file = ARGV.shift
+all = options.delete :all
def get_step(file)
file = file.sub(/\.(info|files)/,'')
Step.new file
end
@@ -37,21 +39,39 @@
nil
end
Log.color(color, status)
end
+def pid_msg(pid, done = false)
+ color = if pid and (done or Misc.pid_exists? pid)
+ :green
+ else
+ :red
+ end
+ if pid.nil?
+ ""
+ else
+ Log.color(color, pid)
+ end
+end
+
step = get_step file
info = step.info
dependencies = info[:dependencies]
inputs = info[:inputs]
status = info[:status]
time = info[:time_elapsed]
messages = info[:messages]
+backtrace = info[:backtrace]
+pid = info[:pid]
+exception = info[:exception]
+rest = info.keys - [:inputs, :dependencies, :status, :time_elapsed, :messages, :backtrace, :exception, :pid]
puts Log.color(:magenta, "File") << ": " << step.path
puts Log.color(:magenta, "Status") << ": " << status_msg(status)
+puts Log.color(:magenta, "Pid") << ": " << pid_msg(pid, status.to_s == "done")
puts Log.color(:magenta, "Time") << ": " << time.to_i.to_s << " sec." if time
if inputs and inputs.any?
puts Log.color(:magenta, "Inputs")
inputs.each do |input,value|
case value
@@ -78,6 +98,18 @@
if messages and messages.any?
puts Log.color(:magenta, "Messages") << ": "
messages.each do |msg|
puts " " << msg
end
+end
+
+if status == :error
+ puts Log.color(:magenta, "Backtrace") << ": "
+ puts Log.color_stack backtrace
+end
+
+if all
+ puts Log.color(:magenta, "Other entries") << ": "
+ rest.each do |key|
+ puts Misc.format_definition_list_item(key, info[key].to_s)
+ end
end