Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging to basic video chat sample #90

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion Basic-Video-Chat/Basic-Video-Chat.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
A05375D91EB1633400645696 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A05375D11EB1633400645696 /* LaunchScreen.storyboard */; };
A05375DA1EB1633400645696 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A05375D31EB1633400645696 /* Main.storyboard */; };
A05375DC1EB1633400645696 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A05375D61EB1633400645696 /* ViewController.swift */; };
F825CCC522CD0728005F9085 /* OTKLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = F825CCC422CD0728005F9085 /* OTKLogger.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -21,6 +22,9 @@
A05375D41EB1633400645696 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
A05375D51EB1633400645696 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A05375D61EB1633400645696 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
F825CCC222CD0727005F9085 /* Basic-Video-Chat-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Basic-Video-Chat-Bridging-Header.h"; sourceTree = "<group>"; };
F825CCC322CD0728005F9085 /* OTKLogger.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OTKLogger.h; sourceTree = "<group>"; };
F825CCC422CD0728005F9085 /* OTKLogger.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OTKLogger.m; sourceTree = "<group>"; };
F86C649A1D5C7C630081846D /* Basic-Video-Chat.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Basic-Video-Chat.app"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -48,9 +52,20 @@
path = "Basic-Video-Chat";
sourceTree = "<group>";
};
F825CCC122CD06FF005F9085 /* Support */ = {
isa = PBXGroup;
children = (
F825CCC322CD0728005F9085 /* OTKLogger.h */,
F825CCC422CD0728005F9085 /* OTKLogger.m */,
F825CCC222CD0727005F9085 /* Basic-Video-Chat-Bridging-Header.h */,
);
path = Support;
sourceTree = "<group>";
};
F86C64911D5C7C630081846D = {
isa = PBXGroup;
children = (
F825CCC122CD06FF005F9085 /* Support */,
A05375CE1EB1633400645696 /* Basic-Video-Chat */,
F86C649B1D5C7C630081846D /* Products */,
);
Expand Down Expand Up @@ -97,7 +112,7 @@
F86C64991D5C7C630081846D = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = "";
LastSwiftMigration = 0930;
LastSwiftMigration = 1100;
ProvisioningStyle = Manual;
};
};
Expand All @@ -107,6 +122,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -138,6 +154,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F825CCC522CD0728005F9085 /* OTKLogger.m in Sources */,
A05375DC1EB1633400645696 /* ViewController.swift in Sources */,
A05375D71EB1633400645696 /* AppDelegate.swift in Sources */,
);
Expand Down Expand Up @@ -271,13 +288,16 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "$(SRCROOT)/Basic-Video-Chat/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.tokbox.Hello-World";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Support/Basic-Video-Chat-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
};
name = Debug;
Expand All @@ -286,11 +306,13 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "$(SRCROOT)/Basic-Video-Chat/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.tokbox.Hello-World";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Support/Basic-Video-Chat-Bridging-Header.h";
SWIFT_VERSION = 4.2;
};
name = Release;
Expand Down
3 changes: 3 additions & 0 deletions Basic-Video-Chat/Basic-Video-Chat/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

// Uncomment below line to show logs
// let _ = OTKLogger()
return true
}
}
Expand Down
8 changes: 4 additions & 4 deletions Basic-Video-Chat/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PODS:
- OpenTok (2.15.0)
- OpenTok (2.16.1)

DEPENDENCIES:
- OpenTok (= 2.15.0)
- OpenTok (= 2.16.1)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- OpenTok

SPEC CHECKSUMS:
OpenTok: f2729ddade8dae49f233b22670dc795ecd236660
OpenTok: 556374577b66cbf791190c84612346c8f3997c9e

PODFILE CHECKSUM: 5d5d67221d38bc9f64ee6b0f086eae6bcf9072ca

COCOAPODS: 1.5.3
COCOAPODS: 1.7.3
6 changes: 6 additions & 0 deletions Basic-Video-Chat/Support/Basic-Video-Chat-Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//

#import <OpenTok/OpenTok.h>
#import "OTKLogger.h"
16 changes: 16 additions & 0 deletions Basic-Video-Chat/Support/OTKLogger.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// OTKLogger.h
// Basic-Video-Chat
//
// Created by rpc on 03/07/2019.
// Copyright © 2019 tokbox. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
@interface OTKLogger : NSObject

@end

NS_ASSUME_NONNULL_END
28 changes: 28 additions & 0 deletions Basic-Video-Chat/Support/OTKLogger.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// OTKLogger.m
// Basic-Video-Chat
//
// Created by rpc on 03/07/2019.
// Copyright © 2019 tokbox. All rights reserved.
//

#import "OTKLogger.h"

@interface OpenTokObjC : NSObject
+ (void)setLogBlockQueue:(dispatch_queue_t)queue;
+ (void)setLogBlock:(void (^)(NSString* message, void* arg))logBlock;
@end

static dispatch_queue_t _logQueue;

@implementation OTKLogger
+ (void)initialize {
_logQueue = dispatch_queue_create("log-queue", DISPATCH_QUEUE_SERIAL);
[OpenTokObjC setLogBlockQueue:_logQueue];
[OpenTokObjC setLogBlock:^(NSString *message, void *arg) {
NSLog(@"%@", message);
}];
}
@end