This repository was archived by the owner on Apr 20, 2018. It is now read-only.
forked from microsoft/Tx
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathUlsRecord.cs
More file actions
46 lines (39 loc) · 1.51 KB
/
UlsRecord.cs
File metadata and controls
46 lines (39 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
using System;
namespace UlsLogs
{
public class UlsRecord
{
DateTimeOffset _time;
string _process;
string _product;
string _category;
Guid _correlation;
ushort _flags;
string _message;
string _eventId;
public UlsRecord(string line)
{
if (line == null)
throw new ArgumentNullException("line");
string[] tokens = line.Split('\t');
if (tokens.Length < 7)
throw new Exception("The argument 'line' contains less than 7 tokens separated by tabs:\n" + line);
_time = DateTimeOffset.Parse(tokens[0]);
_process = tokens[1];
_product = tokens[3];
_category = tokens[4];
_eventId = tokens[5];
_message = tokens[7];
_correlation = tokens[8] != "" ? new Guid(tokens[8]) : Guid.Empty;
}
public DateTimeOffset Time { get { return _time; } }
public string Process { get { return _process; } }
public string Product { get { return _product; } }
public string Category { get { return _category; } }
public Guid Correlation { get { return _correlation; } }
public ushort Flags { get { return _flags; } }
public string Message { get { return _message; } }
public string EventId { get { return _eventId; } }
}
}