Class: OrmDev::LogUtil
- Inherits:
-
Object
- Object
- OrmDev::LogUtil
- Defined in:
- lib/ormdev/source/util/log_util.rb
Constant Summary collapse
- ORMDEV_CLT_INFO_LOG_FLAG =
'[OrmDev]'
Class Method Summary collapse
- .debug(msg = '') ⇒ Object
- .info(msg = '') ⇒ Object
- .link(link, message) ⇒ Object
- .print_command(content) ⇒ Object
- .print_error(content) ⇒ Object
- .print_success(content) ⇒ Object
Class Method Details
.debug(msg = '') ⇒ Object
9 10 11 |
# File 'lib/ormdev/source/util/log_util.rb', line 9 def self.debug(msg = '') puts msg end |
.info(msg = '') ⇒ Object
13 14 15 |
# File 'lib/ormdev/source/util/log_util.rb', line 13 def self.info(msg = '') puts "#{ORMDEV_CLT_INFO_LOG_FLAG}#{msg}" end |
.link(link, message) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ormdev/source/util/log_util.rb', line 17 def self.link(link, ) puts unless .nil? unless link.nil? puts " - " + link.blue.underlined if ENV["TERM_PROGRAM"] == "iTerm.app" puts " ( hold cmd and click links to open in a browser. )".magenta else puts " ( hold cmd and double click links to open in a browser. )".magenta end end end |
.print_command(content) ⇒ Object
30 31 32 |
# File 'lib/ormdev/source/util/log_util.rb', line 30 def self.print_command(content) puts content.green.bold end |
.print_error(content) ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/ormdev/source/util/log_util.rb', line 44 def self.print_error(content) puts '****************************************'.red puts "* #{Time.new} *".red puts '* *'.red puts '* Error ~ *'.red.bold puts '* *'.red puts content puts '****************************************'.red end |
.print_success(content) ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/ormdev/source/util/log_util.rb', line 34 def self.print_success(content) puts '****************************************'.green puts "* #{Time.new} *".green puts '* *'.green puts '* OK ~ *'.green.bold puts '* *'.green puts content puts '****************************************'.green end |