Skip to content

Commit 414fff1

Browse files
authored
Merge pull request #53 from jcesarmobile/change-log-level
Change GCDWebServer log level to Warning
2 parents b0ac6f7 + f73c4a8 commit 414fff1

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

ios/Capacitor/Capacitor/CAPBridgeViewController.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,17 @@ class CAPBridgeViewController: UIViewController, WKScriptMessageHandler, WKUIDel
5959
print("🥑 Avocado can run. Ensure you've run avocado sync at least once")
6060
exit(1)
6161
}
62+
63+
startWebServer()
64+
65+
let request = URLRequest(url: URL(string: "http://localhost:8080/index.html")!)
66+
_ = webView?.load(request)
67+
68+
}
69+
70+
func startWebServer() {
6271
let publicPath = Bundle.main.path(forResource: "public", ofType: nil)
72+
GCDWebServer.setLogLevel(3)
6373
self.webServer = GCDWebServer.init()
6474
self.webServer?.addGETHandler(forBasePath: "/", directoryPath: publicPath!, indexFilename: nil, cacheAge: 3600, allowRangeRequests: true)
6575

@@ -73,12 +83,7 @@ class CAPBridgeViewController: UIViewController, WKScriptMessageHandler, WKUIDel
7383
} catch {
7484
print(error)
7585
}
76-
77-
let request = URLRequest(url: URL(string: "http://localhost:8080/index.html")!)
78-
_ = webView?.load(request)
79-
8086
}
81-
8287
public func configureWebView(configuration: WKWebViewConfiguration) {
8388
configuration.allowsInlineMediaPlayback = true
8489
configuration.suppressesIncrementalRendering = false

0 commit comments

Comments
 (0)