Skip to content

Commit ad283f7

Browse files
Align DataSourceStatus and DataStoreStatus ToString() methods with BigSegmentStoreStatus ToString()
The BigSegmentStoreStatus struct returns data in the format (Available={0},Stale{1)} injecting the fields in allowing the type to be easily stringified. DataSourceStatus and DataStoreStatus only output a string of the internal fields without labels, making decoding the results difficult without understanding the datils of these types. This change adds in the labeling of fields so they can be clearly understood when using the default ToString() implementation. BigSegmentStoreStatus has also been updated to include its type name like the other two status providers. Now all follow the pattern Type(Field=Value,Field2=Value...)
1 parent 2cc03e6 commit ad283f7

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

pkgs/sdk/server/src/Interfaces/BigSegmentStoreStatus.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ public struct BigSegmentStoreStatus
4040

4141
/// <inheritdoc/>
4242
public override string ToString() =>
43-
string.Format("(Available={0},Stale={1})", Available, Stale);
43+
string.Format("BigSegmentStoreStatus(Available={0},Stale={1})", Available, Stale);
4444
}
4545
}

pkgs/sdk/server/src/Interfaces/DataSourceStatus.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public struct DataSourceStatus
4949

5050
/// <inheritdoc/>
5151
public override string ToString() =>
52-
string.Format("DataSourceStatus({0},{1},{2})", State, StateSince, LastError);
52+
string.Format("DataSourceStatus(State={0},StateSince={1},LastError{2})", State, StateSince, LastError);
5353

5454
/// <summary>
5555
/// A description of an error condition that the data source encountered.
@@ -127,7 +127,7 @@ public override string ToString()
127127
s.Append(Kind.Identifier());
128128
if (StatusCode > 0 || !string.IsNullOrEmpty(Message))
129129
{
130-
s.Append("(");
130+
s.Append('(');
131131
if (StatusCode > 0)
132132
{
133133
s.Append(StatusCode);
@@ -136,13 +136,13 @@ public override string ToString()
136136
{
137137
if (StatusCode > 0)
138138
{
139-
s.Append(",");
139+
s.Append(',');
140140
}
141141
s.Append(Message);
142142
}
143-
s.Append(")");
143+
s.Append(')');
144144
}
145-
s.Append("@");
145+
s.Append('@');
146146
s.Append(Time);
147147
return s.ToString();
148148
}

pkgs/sdk/server/src/Interfaces/DataStoreStatus.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ public struct DataStoreStatus
2929

3030
/// <inheritdoc/>
3131
public override string ToString() =>
32-
string.Format("DataStoreStatus({0},{1})", Available, RefreshNeeded);
32+
string.Format("DataStoreStatus(Available={0},RefreshNeeded={1})", Available, RefreshNeeded);
3333
}
3434
}

0 commit comments

Comments
 (0)