forked from getsentry/XcodeBuildMCP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContentView.swift
More file actions
47 lines (39 loc) · 1.06 KB
/
ContentView.swift
File metadata and controls
47 lines (39 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// ContentView.swift
// MCPTest
//
// Created by Cameron on 16/02/2025.
//
import SwiftUI
import OSLog
struct ContentView: View {
@State private var text = ""
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
TextField("Enter text", text: $text)
.textFieldStyle(RoundedBorderTextFieldStyle())
.padding(.horizontal)
Text(text)
Button("Log something") {
let message = ProcessInfo.processInfo.environment.map { "\($0.key): \($0.value)" }.joined(separator: "\n")
Logger.myApp.debug("Environment: \(message)")
debugPrint("Button was pressed")
text = "You just pressed the button!"
}
}
.padding()
}
}
#Preview {
ContentView()
}
// OS Log Extension
extension Logger {
static let myApp = Logger(
subsystem: "com.cameroncooke.MCPTest",
category: "default"
)
}