2727#import " MSIDJsonSerializer.h"
2828#import " NSDate+MSIDExtensions.h"
2929#import " NSString+MSIDExtensions.h"
30+ #import " MSIDExecutionFlowConstants.h"
3031
3132#define MAX_EXECUTION_FLOW_SIZE 50
3233
@@ -59,19 +60,19 @@ - (void)insertTag:(NSString *)tag
5960{
6061 if ([NSString msidIsStringNilOrBlank: tag])
6162 {
62- MSID_LOG_WITH_CTX_PII (MSIDLogLevelWarning, nil , @" Tag cannot be nil " , nil );
63+ MSID_LOG_WITH_CTX_PII (MSIDLogLevelWarning, nil , MSID_EXECUTION_FLOW_TAG_NIL_MESSAGE , nil );
6364 return ;
6465 }
6566
6667 if (!tid)
6768 {
68- MSID_LOG_WITH_CTX_PII (MSIDLogLevelWarning, nil , @" tid cannot be nil " , nil );
69+ MSID_LOG_WITH_CTX_PII (MSIDLogLevelWarning, nil , MSID_EXECUTION_FLOW_TID_NIL_MESSAGE , nil );
6970 return ;
7071 }
7172
7273 if (!triggeringTime)
7374 {
74- MSID_LOG_WITH_CTX_PII (MSIDLogLevelWarning, nil , @" triggeringTime cannot be nil " , nil );
75+ MSID_LOG_WITH_CTX_PII (MSIDLogLevelWarning, nil , MSID_EXECUTION_FLOW_TRIGGERING_TIME_NIL_MESSAGE , nil );
7576 return ;
7677 }
7778
@@ -91,7 +92,7 @@ - (void)insertTag:(NSString *)tag
9192 MSIDExecutionFlowBlob *blob = [[MSIDExecutionFlowBlob alloc ] initWithTag: tag timeStep: @(ts) threadId: tid];
9293 if (!blob)
9394 {
94- MSID_LOG_WITH_CTX_PII (MSIDLogLevelWarning, nil , @" Failed to create execution flow blob " , nil );
95+ MSID_LOG_WITH_CTX_PII (MSIDLogLevelWarning, nil , MSID_EXECUTION_FLOW_FAILED_TO_CREATE_BLOB_MESSAGE , nil );
9596 return ;
9697 }
9798
@@ -115,7 +116,7 @@ - (void)insertTag:(NSString *)tag
115116- (NSString *)exportExecutionFlowToJSONsWithKeys : (NSSet <NSString *> *)queryKeys
116117{
117118
118- __block NSMutableString *jsonArray = [NSMutableString stringWithString: @" [ " ];
119+ __block NSMutableString *jsonArray = [NSMutableString stringWithString: MSID_EXECUTION_FLOW_JSON_OPEN_BRACKET ];
119120
120121 dispatch_sync (self.executionFlowWritingQueue , ^{
121122 for (NSUInteger i = 0 ; i < self.executionFlow .count ; i++)
@@ -130,16 +131,16 @@ - (NSString *)exportExecutionFlowToJSONsWithKeys:(NSSet<NSString *> *)queryKeys
130131 // Add comma separator if not the last element
131132 if (i < self.executionFlow .count - 1 )
132133 {
133- [jsonArray appendString: @" , " ];
134+ [jsonArray appendString: MSID_EXECUTION_FLOW_JSON_COMMA ];
134135 }
135136 }
136137 }
137138 });
138139
139- [jsonArray appendString: @" ] " ];
140+ [jsonArray appendString: MSID_EXECUTION_FLOW_JSON_CLOSE_BRACKET ];
140141
141142 // Return nil if array is empty
142- if ([jsonArray isEqualToString: @" [] " ])
143+ if ([jsonArray isEqualToString: MSID_EXECUTION_FLOW_JSON_EMPTY_ARRAY ])
143144 {
144145 return nil ;
145146 }
0 commit comments