bin/tl in testlab-0.6.6 vs bin/tl in testlab-0.6.7

- old
+ new

@@ -16,16 +16,20 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ################################################################################ +require 'socket' + require 'gli' require 'testlab' include GLI::App include TestLab::Utility::Misc +HOSTNAME = Socket.gethostname.split('.').first.strip + version TestLab::VERSION program_desc %(TestLab - A toolkit for building virtual computer labs) # program_long_desc %(Program Long Description) @@ -39,20 +43,20 @@ switch [:v, :verbose] pre do |global,command,options,args| global[:v].nil? or (global[:v] == true) and ENV['LOG_LEVEL'] = 'DEBUG' - log_file = File.join(Dir.pwd, "testlab.log") + log_file = File.join(Dir.pwd, "testlab-#{HOSTNAME}.log") @logger = ZTK::Logger.new(log_file) - TestLab::Utility.log_header.each { |line| @logger.info { line } } - @logger.debug { "global(#{global.inspect})" } @logger.debug { "options(#{options.inspect})" } @logger.debug { "args(#{args.inspect})" } @ui = ZTK::UI.new(:logger => @logger) @testlab = TestLab.new(:ui => @ui) + + TestLab::Utility.log_header(@testlab).each { |line| @logger.info { line } } message = format_message("TestLab v#{TestLab::VERSION} Loaded".black.bold) @testlab.ui.stdout.puts(message) true