```swift
let logger = Amplify.Logging.logger(forCategory: "Authentication", forNamespace: "<your-code-namespace>")
do {
    let jsonEncoder = JSONEncoder()
    let person = Person(firstName: "John", lastName: "Doe", age: 25)
    let jsonData = try jsonEncoder.encode(person)
    let jsonString = String(data: jsonData, encoding: String.Encoding.utf8)!
    logger.debug(jsonString)
} catch {
    logger.error("Error encoding person instance")
}
```