Skip to content
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
3 changes: 2 additions & 1 deletion ShipShape/Activities/ASCLogView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import SwiftUI

struct ASCLogView: View {
@Environment(ASCClient.self) var client
@Logger var logger

var body: some View {
List {
Section("Click to print to Xcode log") {
ForEach(client.logEntries) { entry in
Button(entry.url) {
print(entry.response)
logger.debug("\(entry.response)")
}
.buttonStyle(.plain)
}
Expand Down
2 changes: 1 addition & 1 deletion ShipShape/Client/ASCClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class ASCClient {
request.setValue("application/json", forHTTPHeaderField: "Content-Type")

let data = try JSONEncoder().encode(content)
print(String(decoding: data, as: UTF8.self))
logger.info("\(String(decoding: data, as: UTF8.self))")

let (_, response) = try await session.data(for: request, delegate: nil)

Expand Down
2 changes: 1 addition & 1 deletion ShipShape/Utilities/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import Foundation
import OSLog
import os

@propertyWrapper
struct Logger {
Expand Down