Created
August 17, 2015 13:51
-
-
Save hannesoid/d43dc8217031b1bd4c7c to your computer and use it in GitHub Desktop.
Resolve crash on jenkins due to combination of KIWI class loading and OpenTok 2.4.1 Audio initializiation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// OpenTokObjC+Silencer.m | |
// | |
// Created by Hannes Oud on 17.08.15. | |
// | |
#if TEST | |
extern void otk_console_set_logger(void(*)(const char*)); | |
void logger (const char* a) { /* empty logging */ } | |
@interface OpenTokObjC : NSObject | |
@end | |
@interface OpenTokObjC (Silencer) | |
@end | |
/** | |
OpenTok crashes on Jenkins, when KIWI loads all classes and induces initialize, where OpenTok initializes Audio, which doesn't work on Jenkins, mostly. The following hack prevents OpenTok from doing it's black magic. Also we remove a logging-warning. | |
Compile this with each Test Target. | |
*/ | |
@implementation OpenTokObjC (Silencer) | |
+ (void)initialize | |
{ | |
// opentok, please do nothing | |
} | |
+ (void)load | |
{ | |
// prevent OpenTok from loading and initializing. Instead, also set the logger, so no warnings appear in console | |
otk_console_set_logger(logger); | |
} | |
@end | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Your code is in objective c but I want to set otk_console_set_logger in swift as I am getting below error in swift Basic Video sample app.
NOTICE: OPENTOK CONSOLE LOGGER HAS NOT BEEN SET.
PLEASE USE otk_console_set_logger(otk_console_logger)
TO SET YOUR LOGGER
Can you please help me on this. it's urgent.