Closed ghasemdev closed 2 years ago
@ghasemdev I really appreciate your help. This is nice!
Please fix the test and swift code.
Change the message_
.
shared.log(
priority: logLevel,
tag: tag ?? {
let fileName = URL(fileURLWithPath: file).lastPathComponent
let functionName: String
if let firstBraceIndex = function.firstIndex(of: "(") {
functionName = String(function[..<firstBraceIndex])
} else {
functionName = function
}
return "\(fileName):\(functionName)"
}(),
throwable: nil,
message: message
)
@ghasemdev I really appreciate your help. This is nice!
Please fix the test and swift code.
- ios/Napier/Napier.swift
Change the
message_
.shared.log( priority: logLevel, tag: tag ?? { let fileName = URL(fileURLWithPath: file).lastPathComponent let functionName: String if let firstBraceIndex = function.firstIndex(of: "(") { functionName = String(function[..<firstBraceIndex]) } else { functionName = function } return "\(fileName):\(functionName)" }(), throwable: nil, message: message )
Thanks, Also I fixed that problem.
Sorry for pointing this out again and again. Does it need to reorder the arguments of the previously defined function?
The sample project doesn't work now.
mpp-sample/src/commonMain/.../Sample.kt
fun handleError() {
try {
throw Exception("throw error")
} catch (e: Exception) {
Napier.e("Napier Error", e) // error
}
}
The order of the arguments should remain the same as before because I think there are only a few situations where a tag is used.
Sorry for pointing this out again and again. Does it need to reorder the arguments of the previously defined function?
The sample project doesn't work now.
mpp-sample/src/commonMain/.../Sample.kt
fun handleError() { try { throw Exception("throw error") } catch (e: Exception) { Napier.e("Napier Error", e) // error } }
The order of the arguments should remain the same as before because I think there are only a few situations where a tag is used.
I think you are right. I did not notice that we can configure the tag through the DebugAntilog class. I'm sorry that most of the tests lead to errors. I don't have Android SDK in the IntelliJ and the project dependencies are not installed properly and I can't run the tests.
I fix issue and commit again.
I have another question, This enum class is un useless?
Changes:
Please accept pull request.