Class: Coursemology::Evaluator::Logging::ClientLogSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- Coursemology::Evaluator::Logging::ClientLogSubscriber
- Defined in:
- lib/coursemology/evaluator/logging/client_log_subscriber.rb
Instance Method Summary collapse
- #allocate(event) ⇒ Object
- #allocate_fail(e:) ⇒ Object
- #evaluate(event) ⇒ Object
- #publish(name, *args) ⇒ Object
- #save(event) ⇒ Object
Instance Method Details
#allocate(event) ⇒ Object
7 8 9 |
# File 'lib/coursemology/evaluator/logging/client_log_subscriber.rb', line 7 def allocate(event) info color("Client: Allocate (#{event.duration.round(1)}ms)", MAGENTA) end |
#allocate_fail(e:) ⇒ Object
11 12 13 |
# File 'lib/coursemology/evaluator/logging/client_log_subscriber.rb', line 11 def allocate_fail(e:) error color("Client: Allocate failed: #{e.}", RED) end |
#evaluate(event) ⇒ Object
15 16 17 18 |
# File 'lib/coursemology/evaluator/logging/client_log_subscriber.rb', line 15 def evaluate(event) info "#{color("Client: Evaluate (#{event.duration.round(1)}ms)", CYAN)} "\ "#{event.payload[:evaluation].language.class.display_name}" end |
#publish(name, *args) ⇒ Object
3 4 5 |
# File 'lib/coursemology/evaluator/logging/client_log_subscriber.rb', line 3 def publish(name, *args) send(name.split('.').first, *args) end |
#save(event) ⇒ Object
20 21 22 |
# File 'lib/coursemology/evaluator/logging/client_log_subscriber.rb', line 20 def save(event) info color("Client: Save (#{event.duration.round(1)}ms)", GREEN) end |