Class: Baykit::BayServer::Docker::BuiltIn::LogBoat
- Inherits:
-
WaterCraft::Boat
- Object
- WaterCraft::Boat
- Baykit::BayServer::Docker::BuiltIn::LogBoat
- Includes:
- Agent::Transporter::DataListener, Protocol
- Defined in:
- lib/baykit/bayserver/docker/built_in/log_boat.rb
Defined Under Namespace
Classes: LogPacket
Constant Summary
Constants inherited from WaterCraft::Boat
WaterCraft::Boat::BOAT_ID_NOCHECK, WaterCraft::Boat::INVALID_BOAT_ID
Instance Attribute Summary collapse
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
-
#postman ⇒ Object
readonly
Returns the value of attribute postman.
Instance Method Summary collapse
-
#init(file_name, postman) ⇒ Object
Custom methods.
-
#initialize ⇒ LogBoat
constructor
A new instance of LogBoat.
- #log(data) ⇒ Object
-
#notify_close ⇒ Object
Implements DataListener.
-
#reset ⇒ Object
Implements Reusable.
- #to_s ⇒ Object
Methods included from Agent::Transporter::DataListener
#check_timeout, #notify_connect, #notify_eof, #notify_handshake_done, #notify_protocol_error, #notify_read
Methods inherited from WaterCraft::Boat
Constructor Details
#initialize ⇒ LogBoat
23 24 25 |
# File 'lib/baykit/bayserver/docker/built_in/log_boat.rb', line 23 def initialize() super end |
Instance Attribute Details
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name.
20 21 22 |
# File 'lib/baykit/bayserver/docker/built_in/log_boat.rb', line 20 def file_name @file_name end |
#postman ⇒ Object (readonly)
Returns the value of attribute postman.
21 22 23 |
# File 'lib/baykit/bayserver/docker/built_in/log_boat.rb', line 21 def postman @postman end |
Instance Method Details
#init(file_name, postman) ⇒ Object
Custom methods
52 53 54 55 56 |
# File 'lib/baykit/bayserver/docker/built_in/log_boat.rb', line 52 def init(file_name, postman) init_boat() @file_name = file_name @postman = postman end |
#log(data) ⇒ Object
58 59 60 61 62 63 64 65 |
# File 'lib/baykit/bayserver/docker/built_in/log_boat.rb', line 58 def log(data) if data == nil data = "" end data += CharUtil::LF @postman.post(data, nil, file_name) end |
#notify_close ⇒ Object
Implements DataListener
44 45 46 |
# File 'lib/baykit/bayserver/docker/built_in/log_boat.rb', line 44 def notify_close() BayLog.info("Log closed: %s", self.file_name) end |
#reset ⇒ Object
Implements Reusable
35 36 37 38 |
# File 'lib/baykit/bayserver/docker/built_in/log_boat.rb', line 35 def reset() @file_name = nil @postman = nil end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/baykit/bayserver/docker/built_in/log_boat.rb', line 27 def to_s() return "lboat##{@boart_id}/#{@object_id} file=#{@file_name}"; end |