mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Adds Logs technote
This commit is contained in:
20
Technotes/Logs.md
Normal file
20
Technotes/Logs.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Logs
|
||||
|
||||
`RSCore` contains a protocol called `Logging`. Classes and Structs that conform to `Logging` have a `logger` variable that the Class or Struct can use instead of importing `os.log` and creating a `var log = Logger(..)` variable.
|
||||
|
||||
Example:
|
||||
|
||||
```swift
|
||||
|
||||
import Foundation
|
||||
import RSCore
|
||||
|
||||
class Sample: Logging {
|
||||
|
||||
init() {
|
||||
logger.debug("Init")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user