def message(text)
if !@connection
timestamp_string = AnalyticsLogger.timestamp_string
DebugLogging.trace(3, "[Union Station log to null] #{@txn_id} #{timestamp_string} #{text}")
return
end
@connection.synchronize do
return if !@connection.connected?
begin
timestamp_string = AnalyticsLogger.timestamp_string
DebugLogging.trace(3, "[Union Station log] #{@txn_id} #{timestamp_string} #{text}")
@connection.channel.write("log", @txn_id, timestamp_string)
@connection.channel.write_scalar(text)
rescue SystemCallError, IOError => e
@connection.disconnect
DebugLogging.warn("Error communicating with the logging agent: #{e.message}")
rescue Exception => e
@connection.disconnect
raise e
end
end
end