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

Harmonize fixture logging #1601

Merged
merged 4 commits into from
Nov 3, 2023
Merged
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
12 changes: 11 additions & 1 deletion features/fixtures/ios/iOSTestApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
01F6B75E2832757F00B75C5D /* OversizedCrashReportScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F6B75C2832757F00B75C5D /* OversizedCrashReportScenario.swift */; };
01F6B75F2832757F00B75C5D /* OversizedHandledErrorScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F6B75D2832757F00B75C5D /* OversizedHandledErrorScenario.swift */; };
01FA9EC426D63BB20059FF4A /* AppHangInTerminationScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01FA9EC326D63BB20059FF4A /* AppHangInTerminationScenario.swift */; };
095E095A2AF3BE8D00273F1F /* Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 095E09592AF3BE8D00273F1F /* Logging.swift */; };
095E095D2AF3BFDA00273F1F /* Logging.m in Sources */ = {isa = PBXBuildFile; fileRef = 095E095C2AF3BFDA00273F1F /* Logging.m */; };
6526A0D4248A83350002E2C9 /* LoadConfigFromFileAutoScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6526A0D3248A83350002E2C9 /* LoadConfigFromFileAutoScenario.swift */; };
8A096DF627C7E56C00DB6ECC /* CxxUnexpectedScenario.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8A096DF527C7E56C00DB6ECC /* CxxUnexpectedScenario.mm */; };
8A096DFC27C7E77600DB6ECC /* CxxBareThrowScenario.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8A096DFB27C7E77600DB6ECC /* CxxBareThrowScenario.mm */; };
Expand Down Expand Up @@ -283,6 +285,9 @@
01F6B75C2832757F00B75C5D /* OversizedCrashReportScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OversizedCrashReportScenario.swift; sourceTree = "<group>"; };
01F6B75D2832757F00B75C5D /* OversizedHandledErrorScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OversizedHandledErrorScenario.swift; sourceTree = "<group>"; };
01FA9EC326D63BB20059FF4A /* AppHangInTerminationScenario.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppHangInTerminationScenario.swift; sourceTree = "<group>"; };
095E09592AF3BE8D00273F1F /* Logging.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logging.swift; sourceTree = "<group>"; };
095E095B2AF3BFDA00273F1F /* Logging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Logging.h; sourceTree = "<group>"; };
095E095C2AF3BFDA00273F1F /* Logging.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Logging.m; sourceTree = "<group>"; };
6526A0D3248A83350002E2C9 /* LoadConfigFromFileAutoScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoadConfigFromFileAutoScenario.swift; sourceTree = "<group>"; };
8A096DF527C7E56C00DB6ECC /* CxxUnexpectedScenario.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CxxUnexpectedScenario.mm; sourceTree = "<group>"; };
8A096DFB27C7E77600DB6ECC /* CxxBareThrowScenario.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CxxBareThrowScenario.mm; sourceTree = "<group>"; };
Expand Down Expand Up @@ -454,6 +459,7 @@
isa = PBXGroup;
children = (
AA4C7F1429AEA0C4009B09A9 /* BugsnagWrapper.swift */,
095E09592AF3BE8D00273F1F /* Logging.swift */,
);
name = utils;
path = ../shared/utils;
Expand Down Expand Up @@ -547,10 +553,13 @@
8AB1081823301FE600672818 /* HandledErrorValidReleaseStageScenario.swift */,
F429526319377A8848136413 /* HandledExceptionScenario.swift */,
8AF8FCAD22BD23BA00A967CA /* HandledInternalNotifyScenario.swift */,
967F6F1129B2236A0054EED8 /* InternalWorkingsScenario.swift */,
01847DD526453D4E00ADA4C7 /* InvalidCrashReportScenario.m */,
01B6BB7425D5748800FC4DE6 /* LastRunInfoScenario.swift */,
6526A0D3248A83350002E2C9 /* LoadConfigFromFileAutoScenario.swift */,
8AB65FCB22DC77CB001200AB /* LoadConfigFromFileScenario.swift */,
095E095B2AF3BFDA00273F1F /* Logging.h */,
095E095C2AF3BFDA00273F1F /* Logging.m */,
E7B79CD1247FD66E0039FB88 /* ManualContextClientScenario.swift */,
E7B79CCF247FD6660039FB88 /* ManualContextConfigurationScenario.swift */,
E7B79CD3247FD6760039FB88 /* ManualContextOnErrorScenario.swift */,
Expand Down Expand Up @@ -657,7 +666,6 @@
010BAAF22833CE570003FF36 /* UserPersistencePersistUserClientScenario.m */,
010BAAF82833CE570003FF36 /* UserPersistencePersistUserScenario.m */,
E700EE49247D1164008CFFB6 /* UserSessionOverrideScenario.swift */,
967F6F1129B2236A0054EED8 /* InternalWorkingsScenario.swift */,
);
name = scenarios;
path = ../shared/scenarios;
Expand Down Expand Up @@ -843,10 +851,12 @@
010BAB0B2833CE570003FF36 /* CxxExceptionOverrideScenario.mm in Sources */,
01DE903826CE99B800455213 /* CriticalThermalStateScenario.swift in Sources */,
01B6BBB625DA82B800FC4DE6 /* SendLaunchCrashesSynchronouslyScenario.swift in Sources */,
095E095D2AF3BFDA00273F1F /* Logging.m in Sources */,
F4295836C8AF75547C675E8D /* ReleasedObjectScenario.m in Sources */,
01E5EAD225B713990066EA8A /* OOMScenario.m in Sources */,
010BAB3D2833D2890003FF36 /* DisabledReleaseStageManualSessionScenario.swift in Sources */,
01F6B75E2832757F00B75C5D /* OversizedCrashReportScenario.swift in Sources */,
095E095A2AF3BE8D00273F1F /* Logging.swift in Sources */,
8A530CCC22FDDBF000F0C108 /* ManyConcurrentNotifyScenario.m in Sources */,
010BAB112833CEEC0003FF36 /* AppAndDeviceAttributesConfigOverrideScenario.swift in Sources */,
010BAB0A2833CE570003FF36 /* DisableSignalsExceptionScenario.m in Sources */,
Expand Down
2 changes: 2 additions & 0 deletions features/fixtures/ios/iOSTestApp/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import UIKit
import os

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
logInfo("========== Fixture app has launched ==========")
return true
}
}
18 changes: 0 additions & 18 deletions features/fixtures/ios/iOSTestApp/CommandReaderThread.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,3 @@ class CommandReaderThread: Thread {
return bsAddress;
}
}

private func logInfo(_ message: String) {
let fullMessage = String(format: "bugsnagci info: %@", message)
NSLog("%@", fullMessage)
kslog("\(Date()) \(fullMessage)")
}

private func logWarn(_ message: String) {
let fullMessage = String(format: "bugsnagci warn: %@", message)
NSLog("%@", fullMessage)
kslog("\(Date()) \(fullMessage)")
}

private func logError(_ message: String) {
let fullMessage = String(format: "bugsnagci error: %@", message)
NSLog("%@", fullMessage)
kslog("\(Date()) \(fullMessage)")
}
14 changes: 5 additions & 9 deletions features/fixtures/ios/iOSTestApp/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class ViewController: UIViewController {
self.view.addGestureRecognizer(UITapGestureRecognizer(target: self.view, action: #selector(UIView.endEditing(_:))))
NotificationCenter.default.addObserver(self, selector: #selector(didEnterBackgroundNotification), name: UIApplication.didEnterBackgroundNotification, object: nil)
apiKeyField.text = UserDefaults.standard.string(forKey: "apiKey")
logInfo("Read API key from UserDefaults: \(apiKeyField.text!)")

// Poll for commands to run
if #available(iOS 10.0, *) {
Expand All @@ -43,18 +44,18 @@ class ViewController: UIViewController {
if Scenario.current == nil {
prepareScenario()

log("Starting Bugsnag for scenario: \(Scenario.current!)")
logInfo("Starting Bugsnag for scenario: \(Scenario.current!)")
Scenario.current!.startBugsnag()
}

log("Running scenario: \(Scenario.current!)")
logInfo("Running scenario: \(Scenario.current!)")
Scenario.current!.run()
}

@IBAction func startBugsnag() {
prepareScenario()

log("Starting Bugsnag for scenario: \(Scenario.current!)")
logInfo("Starting Bugsnag for scenario: \(Scenario.current!)")
Scenario.current!.startBugsnag()
}

Expand All @@ -67,7 +68,7 @@ class ViewController: UIViewController {
if (apiKeyField.text!.count > 0) {
// Manual testing mode - use the real dashboard and the API key provided
let apiKey = apiKeyField.text!
NSLog("Running in manual mode with API key: %@", apiKey)
logInfo("Running in manual mode with API key: \(apiKey)")
UserDefaults.standard.setValue(apiKey, forKey: "apiKey")
config = BugsnagConfiguration(apiKeyField.text!)
}
Expand All @@ -81,8 +82,3 @@ class ViewController: UIViewController {
Scenario.current?.didEnterBackgroundNotification()
}
}

private func log(_ message: String) {
NSLog("%@", message)
kslog("\(Date()) \(message)")
}
10 changes: 10 additions & 0 deletions features/fixtures/macos/macOSTestApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@
01F6B74F2832381300B75C5D /* OversizedCrashReportScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F6B74B2832381300B75C5D /* OversizedCrashReportScenario.swift */; };
01F7365A278D90440000113C /* NetworkBreadcrumbsScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F73659278D90440000113C /* NetworkBreadcrumbsScenario.swift */; };
01FA9EC626D64FFF0059FF4A /* AppHangInTerminationScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01FA9EC526D64FFF0059FF4A /* AppHangInTerminationScenario.swift */; };
095E095F2AF3C98F00273F1F /* Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 095E095E2AF3C98F00273F1F /* Logging.swift */; };
095E09622AF3C9A500273F1F /* Logging.m in Sources */ = {isa = PBXBuildFile; fileRef = 095E09612AF3C9A500273F1F /* Logging.m */; };
8A096DF827C7E63A00DB6ECC /* CxxUnexpectedScenario.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8A096DF727C7E63A00DB6ECC /* CxxUnexpectedScenario.mm */; };
8A096DFA27C7E6D800DB6ECC /* CxxBareThrowScenario.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8A096DF927C7E6D800DB6ECC /* CxxBareThrowScenario.mm */; };
967F6F1629B767CE0054EED8 /* InternalWorkingsScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 967F6F1529B767CE0054EED8 /* InternalWorkingsScenario.swift */; };
Expand Down Expand Up @@ -388,6 +390,9 @@
01F6B74B2832381300B75C5D /* OversizedCrashReportScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OversizedCrashReportScenario.swift; sourceTree = "<group>"; };
01F73659278D90440000113C /* NetworkBreadcrumbsScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkBreadcrumbsScenario.swift; sourceTree = "<group>"; };
01FA9EC526D64FFF0059FF4A /* AppHangInTerminationScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppHangInTerminationScenario.swift; sourceTree = "<group>"; };
095E095E2AF3C98F00273F1F /* Logging.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Logging.swift; sourceTree = "<group>"; };
095E09602AF3C9A500273F1F /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Logging.h; sourceTree = "<group>"; };
095E09612AF3C9A500273F1F /* Logging.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Logging.m; sourceTree = "<group>"; };
2C49722B331FF4B0DC477462 /* Pods-macOSTestApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-macOSTestApp.release.xcconfig"; path = "Target Support Files/Pods-macOSTestApp/Pods-macOSTestApp.release.xcconfig"; sourceTree = "<group>"; };
5C65BFC9838298CFA8A35072 /* Pods_macOSTestApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_macOSTestApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8A096DF727C7E63A00DB6ECC /* CxxUnexpectedScenario.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CxxUnexpectedScenario.mm; sourceTree = "<group>"; };
Expand Down Expand Up @@ -494,6 +499,8 @@
01B6BB7125D56CBF00FC4DE6 /* LastRunInfoScenario.swift */,
01F47C23254B1B2C00B184AD /* LoadConfigFromFileAutoScenario.swift */,
01F47C94254B1B2F00B184AD /* LoadConfigFromFileScenario.swift */,
095E09602AF3C9A500273F1F /* Logging.h */,
095E09612AF3C9A500273F1F /* Logging.m */,
01F47C3B254B1B2D00B184AD /* ManualContextClientScenario.swift */,
01F47C47254B1B2D00B184AD /* ManualContextConfigurationScenario.swift */,
01F47C82254B1B2F00B184AD /* ManualContextOnErrorScenario.swift */,
Expand Down Expand Up @@ -658,6 +665,7 @@
isa = PBXGroup;
children = (
AA4C7F1729AEA31D009B09A9 /* BugsnagWrapper.swift */,
095E095E2AF3C98F00273F1F /* Logging.swift */,
);
name = utils;
path = ../shared/utils;
Expand Down Expand Up @@ -795,6 +803,7 @@
01F47D08254B1B3100B184AD /* AutoSessionCustomVersionScenario.m in Sources */,
01F47CC6254B1B3100B184AD /* HandledExceptionScenario.swift in Sources */,
01F47D0D254B1B3100B184AD /* LoadConfigFromFileScenario.swift in Sources */,
095E09622AF3C9A500273F1F /* Logging.m in Sources */,
01F47CF5254B1B3100B184AD /* StoppedSessionScenario.swift in Sources */,
010BAB772833D34A0003FF36 /* DiscardClassesHandledExceptionRegexScenario.swift in Sources */,
01F47D23254B1B3100B184AD /* SwiftAssertionScenario.swift in Sources */,
Expand Down Expand Up @@ -849,6 +858,7 @@
010BAB722833D34A0003FF36 /* BareboneTestHandledScenario.swift in Sources */,
017D9CFC2833C81100B0AA87 /* DisableMachExceptionScenario.m in Sources */,
01DE903A26CEAD1200455213 /* CriticalThermalStateScenario.swift in Sources */,
095E095F2AF3C98F00273F1F /* Logging.swift in Sources */,
01F47CF9254B1B3100B184AD /* BreadcrumbCallbackDiscardScenario.swift in Sources */,
AA6ACD1E2773E39C006464C4 /* UserInfoScenario.swift in Sources */,
01018BAB25E417EC000312C6 /* AsyncSafeMallocScenario.m in Sources */,
Expand Down
28 changes: 8 additions & 20 deletions features/fixtures/macos/macOSTestApp/MainWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
#import "MainWindowController.h"

#import "Scenario.h"
#import "Logging.h"

#import <Bugsnag/Bugsnag.h>

static void BSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2) NS_NO_TAIL_CALL;


@interface MainWindowController ()

// These properties are used with Cocoa Bindings
Expand Down Expand Up @@ -50,39 +48,39 @@ - (BugsnagConfiguration *)configuration {
}

- (IBAction)runScenario:(id)sender {
BSLog(@"%s %@", __PRETTY_FUNCTION__, self.scenarioName);
logDebug(@"%s %@", __PRETTY_FUNCTION__, self.scenarioName);

// Cater for multiple calls to -run
if (!Scenario.currentScenario) {
[Scenario createScenarioNamed:self.scenarioName withConfig:[self configuration]];
Scenario.currentScenario.eventMode = self.scenarioMetadata;

BSLog(@"Starting Bugsnag for scenario: %@", Scenario.currentScenario);
logInfo(@"Starting Bugsnag for scenario: %@", Scenario.currentScenario);
[Scenario.currentScenario startBugsnag];
}

BSLog(@"Will run scenario: %@", Scenario.currentScenario);
logInfo(@"Will run scenario: %@", Scenario.currentScenario);
// Using dispatch_async to prevent AppleEvents swallowing exceptions.
// For more info see https://www.chimehq.com/blog/sad-state-of-exceptions
// 0.1s delay allows accessibility APIs to finish handling the mouse click and returns control to the tests framework.
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
BSLog(@"Running scenario: %@", Scenario.currentScenario);
logInfo(@"Running scenario: %@", Scenario.currentScenario);
[Scenario.currentScenario run];
});
}

- (IBAction)startBugsnag:(id)sender {
BSLog(@"%s %@", __PRETTY_FUNCTION__, self.scenarioName);
logDebug(@"%s %@", __PRETTY_FUNCTION__, self.scenarioName);

[Scenario createScenarioNamed:self.scenarioName withConfig:[self configuration]];
Scenario.currentScenario.eventMode = self.scenarioMetadata;

BSLog(@"Starting Bugsnag for scenario: %@", Scenario.currentScenario);
logInfo(@"Starting Bugsnag for scenario: %@", Scenario.currentScenario);
[Scenario.currentScenario startBugsnag];
}

- (IBAction)clearPersistentData:(id)sender {
BSLog(@"Clearing persistent data");
logInfo(@"Clearing persistent data");
[Scenario clearPersistentData];
}

Expand All @@ -100,13 +98,3 @@ - (IBAction)executeMazeRunnerCommand:(id)sender {
}

@end


static void BSLog(NSString *format, ...) {
va_list vl;
va_start(vl, format);
NSString *message = [[NSString alloc] initWithFormat:format arguments:vl];
NSLog(@"%@", message);
kslog(message.UTF8String);
va_end(vl);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

#import "MarkUnhandledHandledScenario.h"
#import "Logging.h"

@interface AbortOverrideScenario : MarkUnhandledHandledScenario
@end
Expand Down
1 change: 1 addition & 0 deletions features/fixtures/shared/scenarios/AbortScenario.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

#import "Scenario.h"
#import "Logging.h"

@interface AbortScenario : Scenario
@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

#import "Scenario.h"
#import "Logging.h"

/**
* Call NSLog(@"%@", 16);, causing a crash when the runtime attempts to treat 16 as a pointer to an object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ class AppHangDefaultConfigScenario: Scenario {

override func run() {
let timeInterval: TimeInterval = 5
NSLog("Simulating an app hang of \(timeInterval) seconds...")
logDebug("Simulating an app hang of \(timeInterval) seconds...")
Thread.sleep(forTimeInterval: timeInterval)
NSLog("Finished sleeping")
logDebug("Finished sleeping")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class AppHangDidBecomeActiveScenario: Scenario {

override func run() {
NotificationCenter.default.addObserver(forName: UIApplication.didBecomeActiveNotification, object: nil, queue: nil) {
NSLog("Received \($0.name), now sleeping for 3 seconds...")
logDebug("Received \($0.name), now sleeping for 3 seconds...")
Thread.sleep(forTimeInterval: 3)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class AppHangDidEnterBackgroundScenario: Scenario {

override func run() {
NotificationCenter.default.addObserver(forName: UIApplication.didEnterBackgroundNotification, object: nil, queue: nil) {
NSLog("Received \($0.name), now hanging indefinitely...")
logDebug("Received \($0.name), now hanging indefinitely...")
while true {}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class AppHangDisabledScenario: Scenario {

override func run() {
let timeInterval: TimeInterval = 5
NSLog("Simulating an app hang of \(timeInterval) seconds...")
logDebug("Simulating an app hang of \(timeInterval) seconds...")
Thread.sleep(forTimeInterval: timeInterval)
NSLog("Finished sleeping")
logDebug("Finished sleeping")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AppHangFatalDisabledScenario: Scenario {
}

override func run() {
NSLog("Hanging indefinitely...")
logDebug("Hanging indefinitely...")
// Use asyncAfter to allow the Appium click event to be handled
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
while true {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class AppHangFatalOnlyScenario: Scenario {
}

override func run() {
NSLog("Hanging indefinitely...")
logDebug("Hanging indefinitely...")
// Use asyncAfter to allow the Appium click event to be handled
DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) {
while true {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AppHangInTerminationScenario: Scenario {
#endif

NotificationCenter.default.addObserver(forName: willTerminate, object: nil, queue: nil) {
NSLog("Received \($0.name.rawValue), simulating an app hang...")
logDebug("Received \($0.name.rawValue), simulating an app hang...")
Thread.sleep(forTimeInterval: 3)
}

Expand Down
Loading
Loading