mirror of
https://github.com/apple/swift.git
synced 2026-10-08 12:50:50 +02:00
When building the `OSLog` module, look for a variable named
`osLogStringSectionName`. It must have a string literal as its
initializer, which provides the section name where the log strings
should be emitted. The `OSLog` module should contain something like
this:
let osLogStringSectionName = "__TEXT,__logit"
When not present, the compiler will default to
`__TEXT,__oslogstring,cstring_literals`, which was previously the
hardcoded section name. Now, OSLog can customize the name.
Implements rdar://171571056
9 lines
505 B
Markdown
9 lines
505 B
Markdown
# OSLog module (OSLog)
|
|
|
|
The `OSLog` module defines logging facilities that integrate with the Swift compiler. This module is provided by the platform vendor and integrates with the system logging facilities. The Swift `OSLog` module should provide a module-scope variable declaration that specifies which section the logging strings should be emitted into. For example:
|
|
|
|
```swift
|
|
let osLogStringSectionName = "__TEXT,__logstrings"
|
|
```
|
|
|
|
The initializer of `osLogStringSectionName` must be a string literal. |