Class

OSLog

A custom log object that can be passed to logging functions in order to send messages to the logging system.

Declaration

class OSLog : NSObject

Overview

Custom log objects are identified by an identifier string (in reverse DNS notation, like com.your_company.your_subsystem_name) and a category for the logging subsystem. Both of these are used to categorize and filter related log messages and group related logging settings.

Topics

Creating a Log Object

init(subsystem: String, category: String)

Creates a custom log object, to be passed to logging functions for sending messages to the logging system.

init(subsystem: String, category: OSLog.Category)

Creates a custom log object, to be passed to logging functions for sending messages to the logging system.

struct OSLog.Category

The values that determine how logs are categorized.

Getting the Standard Log Objects

static let `default`: OSLog

The shared default log.

static let disabled: OSLog

The shared disabled log.

Getting the Log Configuration

func isEnabled(type: OSLogType) -> Bool

Returns a Boolean value indicating whether a specific type of logging, such as default, info, debug, error, or fault, is enabled for a specified log object.

var signpostsEnabled: Bool

A Boolean value that indicates whether a log has signpost logging enabled.

Relationships

Inherits From

Conforms To

See Also

Creating a Custom Log Object

struct OSLogType

Logging levels supported by the system.

init(subsystem: String, category: String)

Creates a custom log object, to be passed to logging functions for sending messages to the logging system.