Class: Quark::MdkTracing::FakeTracer

Inherits:
DatawireQuarkCore::QuarkObject show all
Extended by:
DatawireQuarkCore::Static
Defined in:
lib/mdk_tracing.rb

Overview

In-memory testing of logs.

Constant Summary

Constants included from DatawireQuarkCore::Static

DatawireQuarkCore::Static::Unassigned

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DatawireQuarkCore::Static

_lazy_statics, static, unlazy_statics

Methods inherited from DatawireQuarkCore::QuarkObject

#to_s

Constructor Details

#initializeFakeTracer

Returns a new instance of FakeTracer.



88
89
90
91
92
# File 'lib/mdk_tracing.rb', line 88

def initialize()
    self.__init_fields__

    nil
end

Instance Attribute Details

#messagesObject

Returns the value of attribute messages.



81
82
83
# File 'lib/mdk_tracing.rb', line 81

def messages
  @messages
end

Instance Method Details

#__init_fields__Object



151
152
153
154
155
156
# File 'lib/mdk_tracing.rb', line 151

def __init_fields__()
    
    self.messages = ::DatawireQuarkCore::List.new([])

    nil
end

#_getClassObject



125
126
127
128
129
130
# File 'lib/mdk_tracing.rb', line 125

def _getClass()
    
    return "mdk_tracing.FakeTracer"

    nil
end

#_getField(name) ⇒ Object



132
133
134
135
136
137
138
139
140
# File 'lib/mdk_tracing.rb', line 132

def _getField(name)
    
    if ((name) == ("messages"))
        return (self).messages
    end
    return nil

    nil
end

#_setField(name, value) ⇒ Object



142
143
144
145
146
147
148
149
# File 'lib/mdk_tracing.rb', line 142

def _setField(name, value)
    
    if ((name) == ("messages"))
        (self).messages = ::DatawireQuarkCore.cast(value) { ::DatawireQuarkCore::List }
    end

    nil
end

#log(event) ⇒ Object



97
98
99
100
101
102
# File 'lib/mdk_tracing.rb', line 97

def log(event)
    
    (@messages) << ({"level" => (event).level, "category" => (event).category, "text" => (event).text, "context" => ((event).context).traceId})

    nil
end

#onMessage(origin, message) ⇒ Object



118
119
120
121
122
123
# File 'lib/mdk_tracing.rb', line 118

def onMessage(origin, message)
    
    nil

    nil
end

#onStart(dispatcher) ⇒ Object



104
105
106
107
108
109
# File 'lib/mdk_tracing.rb', line 104

def onStart(dispatcher)
    
    nil

    nil
end

#onStopObject



111
112
113
114
115
116
# File 'lib/mdk_tracing.rb', line 111

def onStop()
    
    nil

    nil
end