Skip to content

Commit

Permalink
Separate public utils from private utils appropriately (#913)
Browse files Browse the repository at this point in the history
* Separated public utils from private utils

* Made SEGAnalyticsUtils public.

* Fixed header includes.

Co-authored-by: Brandon Sneed <brandon.sneed@segment.com>
  • Loading branch information
bsneed and Brandon Sneed authored Jun 25, 2020
1 parent 61f487d commit 4e3df7a
Show file tree
Hide file tree
Showing 8 changed files with 373 additions and 372 deletions.
4 changes: 2 additions & 2 deletions Analytics.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@
EADEB89B1DECD12B005322DA /* SEGStorage.h */,
EADEB88A1DECD12B005322DA /* SEGTrackPayload.h */,
EADEB88B1DECD12B005322DA /* SEGTrackPayload.m */,
EADEB88F1DECD12B005322DA /* SEGAnalyticsUtils.h */,
EADEB8901DECD12B005322DA /* SEGAnalyticsUtils.m */,
);
path = Classes;
sourceTree = "<group>";
Expand All @@ -371,8 +373,6 @@
EADEB88E1DECD12B005322DA /* NSData+SEGGZIP.m */,
EADEB8781DECD12B005322DA /* SEGAES256Crypto.h */,
EADEB8791DECD12B005322DA /* SEGAES256Crypto.m */,
EADEB88F1DECD12B005322DA /* SEGAnalyticsUtils.h */,
EADEB8901DECD12B005322DA /* SEGAnalyticsUtils.m */,
EADEB8911DECD12B005322DA /* SEGFileStorage.h */,
EADEB8921DECD12B005322DA /* SEGFileStorage.m */,
EADEB8841DECD12B005322DA /* SEGIntegrationsManager.h */,
Expand Down
10 changes: 10 additions & 0 deletions Analytics/Classes/SEGAnalyticsUtils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

// Logging

void SEGSetShowDebugLogs(BOOL showDebugLogs);
void SEGLog(NSString *format, ...);

NS_ASSUME_NONNULL_END
23 changes: 23 additions & 0 deletions Analytics/Classes/SEGAnalyticsUtils.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#import "SEGAnalyticsUtils.h"
#import "SEGAnalytics.h"

static BOOL kAnalyticsLoggerShowLogs = NO;

// Logging

void SEGSetShowDebugLogs(BOOL showDebugLogs)
{
kAnalyticsLoggerShowLogs = showDebugLogs;
}

void SEGLog(NSString *format, ...)
{
if (!kAnalyticsLoggerShowLogs)
return;

va_list args;
va_start(args, format);
NSLogv(format, args);
va_end(args);
}

2 changes: 1 addition & 1 deletion Analytics/Classes/SEGSegmentIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#import <UIKit/UIKit.h>
#import "SEGAnalytics.h"
#import "SEGAnalyticsUtils.h"
#import "SEGUtils.h"
#import "SEGSegmentIntegration.h"
#import "SEGReachability.h"
#import "SEGHTTPClient.h"
Expand Down
50 changes: 0 additions & 50 deletions Analytics/Internal/SEGAnalyticsUtils.h

This file was deleted.

Loading

0 comments on commit 4e3df7a

Please sign in to comment.