Skip to content

Commit

Permalink
Use ServiceGenerator logging conventions some as other tools.
Browse files Browse the repository at this point in the history
Some other tooling is using NAME.VERSION.json for the file names, so follow that
style.

They also use "index.json" for the directory listing, so use that also.
  • Loading branch information
thomasvl committed Jul 18, 2024
1 parent a8c1e0b commit 1b0c0ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tools/ServiceGenerator/SGMain.m
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ - (void)printUsage:(FILE *)outputFile brief:(BOOL)brief {
- (void)maybeLogAPI:(GTLRDiscovery_RestDescription *)api {
if (self.apiLogDir == nil) return;

NSString *fileName = [NSString stringWithFormat:@"%@_%@.json",
NSString *fileName = [NSString stringWithFormat:@"%@.%@.json",
api.name, api.version];
NSString *filePath = [self.apiLogDir stringByAppendingPathComponent:fileName];
NSError *writeErr = nil;
Expand Down Expand Up @@ -1186,7 +1186,7 @@ - (void)stateDirectory {
} else {
GTLRDiscovery_DirectoryList *apiList = (GTLRDiscovery_DirectoryList *)object;
if (self.apiLogDir != nil) {
NSString *filePath = [self.apiLogDir stringByAppendingPathComponent:@"DirectoryList.json"];
NSString *filePath = [self.apiLogDir stringByAppendingPathComponent:@"index.json"];
NSError *writeErr = nil;
if (![apiList.JSONString writeToFile:filePath
atomically:YES
Expand Down

0 comments on commit 1b0c0ff

Please sign in to comment.