Beispiel #1
0
 public static T Match <T>(this PointValue @value, Func <PointValue.Event, T> onEvent, Func <PointValue.Gauge, T> onGauge)
 {
     if (@value is PointValue.Event)
     {
         return(onEvent(@value as PointValue.Event));
     }
     return(onGauge(@value as PointValue.Gauge));
 }
Beispiel #2
0
 public LogMessage(LogMessage msg, PointValue value)
 {
     this.Name      = msg.Name;
     this.Level     = msg.Level;
     this.Value     = value;
     this.Fields    = msg.Fields;
     this.Timestamp = msg.Timestamp;
 }
Beispiel #3
0
 public LogMessage(string[] name, LogLevel level, PointValue value, ReadOnlyDictionary <string, object> fields, long timestamp)
 {
     Name      = name;
     Level     = level;
     Value     = value;
     Fields    = fields;
     Timestamp = timestamp;
 }
Beispiel #4
0
 public LogMessage(LogMessage msg, PointValue value)
 {
     Name      = msg.Name;
     Level     = msg.Level;
     Value     = value;
     Fields    = msg.Fields;
     Timestamp = msg.Timestamp;
 }
Beispiel #5
0
 /// <summary>
 /// Sets the format of the LogMessage.
 /// </summary>
 public static LogMessage SetEvent(this LogMessage msg, string format)
 {
     return(new LogMessage(msg, PointValue.FromEvent(format)));
 }
Beispiel #6
0
 public static LogMessage SetGuage(this LogMessage msg, long value, string unit)
 {
     return(new LogMessage(msg, PointValue.FromGauge(value, unit)));
 }