Class: BigKeeper::LeanCloudLogger
- Inherits:
-
Object
- Object
- BigKeeper::LeanCloudLogger
- Includes:
- Singleton
- Defined in:
- lib/big_keeper/util/leancloud_logger.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#end_timestamp ⇒ Object
Returns the value of attribute end_timestamp.
-
#is_success ⇒ Object
Returns the value of attribute is_success.
-
#need_log ⇒ Object
Returns the value of attribute need_log.
-
#parameter ⇒ Object
Returns the value of attribute parameter.
-
#path ⇒ Object
Returns the value of attribute path.
-
#start_timestamp ⇒ Object
Returns the value of attribute start_timestamp.
-
#user ⇒ Object
Returns the value of attribute user.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #end_log(is_success, is_show_log) ⇒ Object
-
#initialize ⇒ LeanCloudLogger
constructor
A new instance of LeanCloudLogger.
- #is_need_log ⇒ Object
- #set_command(set_command) ⇒ Object
- #start_log(global_options, args) ⇒ Object
Constructor Details
#initialize ⇒ LeanCloudLogger
Returns a new instance of LeanCloudLogger.
12 13 14 |
# File 'lib/big_keeper/util/leancloud_logger.rb', line 12 def initialize @need_log = "true" end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
10 11 12 |
# File 'lib/big_keeper/util/leancloud_logger.rb', line 10 def command @command end |
#end_timestamp ⇒ Object
Returns the value of attribute end_timestamp.
10 11 12 |
# File 'lib/big_keeper/util/leancloud_logger.rb', line 10 def @end_timestamp end |
#is_success ⇒ Object
Returns the value of attribute is_success.
10 11 12 |
# File 'lib/big_keeper/util/leancloud_logger.rb', line 10 def is_success @is_success end |
#need_log ⇒ Object
Returns the value of attribute need_log.
10 11 12 |
# File 'lib/big_keeper/util/leancloud_logger.rb', line 10 def need_log @need_log end |
#parameter ⇒ Object
Returns the value of attribute parameter.
10 11 12 |
# File 'lib/big_keeper/util/leancloud_logger.rb', line 10 def parameter @parameter end |
#path ⇒ Object
Returns the value of attribute path.
10 11 12 |
# File 'lib/big_keeper/util/leancloud_logger.rb', line 10 def path @path end |
#start_timestamp ⇒ Object
Returns the value of attribute start_timestamp.
10 11 12 |
# File 'lib/big_keeper/util/leancloud_logger.rb', line 10 def @start_timestamp end |
#user ⇒ Object
Returns the value of attribute user.
10 11 12 |
# File 'lib/big_keeper/util/leancloud_logger.rb', line 10 def user @user end |
#version ⇒ Object
Returns the value of attribute version.
10 11 12 |
# File 'lib/big_keeper/util/leancloud_logger.rb', line 10 def version @version end |
Instance Method Details
#end_log(is_success, is_show_log) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/big_keeper/util/leancloud_logger.rb', line 33 def end_log(is_success, is_show_log) @end_timestamp = Time.new.to_i @is_success = is_success @version = BigkeeperParser.version if @version == 'Version in Bigkeeper file' # require parameter = {'start_timestamp' => @start_timestamp, 'end_timestamp' =>@end_timestamp, 'user' =>@user, 'is_success' =>@is_success} # optional parameter = parameter.merge('command' => @command) unless @command == nil parameter = parameter.merge('version' => @version) unless @version == nil || @version == "" parameter = parameter.merge('parameter' => @parameter) unless @parameter == nil || @parameter == "" if @command leancloud_file = @command.split("/").first send_log_cloud(leancloud_file, parameter, is_show_log) end end |
#is_need_log ⇒ Object
20 21 22 |
# File 'lib/big_keeper/util/leancloud_logger.rb', line 20 def is_need_log @need_log == "true" end |
#set_command(set_command) ⇒ Object
16 17 18 |
# File 'lib/big_keeper/util/leancloud_logger.rb', line 16 def set_command(set_command) @command = set_command end |
#start_log(global_options, args) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/big_keeper/util/leancloud_logger.rb', line 24 def start_log(, args) @start_timestamp = Time.new.to_i @user = ['user'].to_s @parameter = args.join(",") @version = ['ver'] @path = ['path'] @need_log = "#{[:log]}" end |