lib/Log.rb in taskjuggler-0.0.3 vs lib/Log.rb in taskjuggler-0.0.4
- old
+ new
@@ -1,11 +1,11 @@
#!/usr/bin/env ruby -w
# encoding: UTF-8
#
# = Log.rb -- The TaskJuggler III Project Management Software
#
-# Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
+# Copyright (c) 2006, 2007, 2008, 2009, 2010 by Chris Schlaeger <cs@kde.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
@@ -97,9 +97,16 @@
return unless showMessage
end
if @@stack.length - offset < @@level
$stderr.puts ' ' * (@@stack.length - offset) + message
end
+ end
+
+ # Print out a status message unless we are in silent mode.
+ def Log.status(message)
+ return if @@silent
+
+ $stdout.puts message
end
# The progress meter can be a textual progress bar or some animated
# character sequence that informs the user about ongoing activities. Call
# this function to start the progress meter display or to change the info