19 using System.Collections.Generic;
21 namespace Deveel.Data.Diagnostics {
22 public sealed
class LogEntry : IEnumerable<KeyValuePair<string, object>> {
23 private readonly Dictionary<string, object>
data;
25 internal LogEntry(IDictionary<string, object> metadata) {
26 data =
new Dictionary<string, object>(metadata);
29 public IEnumerable<string> Keys {
30 get {
return data.Keys; }
35 if (!data.TryGetValue(key, out value))
42 return data.GetEnumerator();
45 IEnumerator IEnumerable.GetEnumerator() {
46 return GetEnumerator();
50 var data =
new Dictionary<string, object>();
52 var source = @
event.EventSource;
53 while (source != null) {
54 var sourceData = source.Metadata;
55 foreach (var pair
in sourceData) {
56 data[pair.Key] = pair.Value;
59 source = source.ParentSource;
63 foreach (var pair
in @event.EventData) {
64 data[pair.Key] = pair.Value;
LogEntry(IDictionary< string, object > metadata)
This is an event occurred during the lifetime of a database.
static LogEntry FromEvent(IEvent @event)
IEnumerator< KeyValuePair< string, object > > GetEnumerator()
IEventSource EventSource
Gets the event source.
readonly Dictionary< string, object > data
object GetValue(string key)