{"library":"pyobjc-framework-oslog","title":"PyObjC OSLog Framework Wrappers","description":"PyObjC-framework-OSLog provides Python wrappers for Apple's OSLog framework on macOS, allowing Python applications to interact with the unified logging system. It is part of the larger PyObjC project, currently at version 12.1, and maintains an active release cadence with frequent updates to align with macOS SDK changes and Python versions.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install pyobjc-framework-oslog"],"cli":null},"imports":["import OSLog","from OSLog import os_log_create"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import OSLog\nfrom Foundation import NSObject\n\ndef main():\n    # Instantiate an OSLog object (equivalent to Objective-C: [[OSLog alloc] initWithSubsystem:category:])\n    # os_log_create is an alternative to OSLog.alloc().init...\n    log_handle = OSLog.os_log_create('com.example.myapp', 'general')\n\n    # Log a message at the default level (OS_LOG_TYPE_DEFAULT)\n    # Equivalent to Objective-C: os_log(log_handle, \"Hello from PyObjC OSLog!\");\n    # Note: For simplicity, string formatting and privacy modifiers (%{public}s, %{private}s) are not shown here\n    # as they typically apply to C-level os_log calls. PyObjC handles basic strings directly.\n    OSLog.os_log_with_type(log_handle, OSLog.OS_LOG_TYPE_DEFAULT, 'Hello from PyObjC OSLog!')\n    print('Logged a message to system console. Check Console.app for \"Hello from PyObjC OSLog!\".')\n\nif __name__ == '__main__':\n    main()","lang":"python","description":"This quickstart demonstrates how to import the OSLog framework and log a simple message to the macOS unified logging system. It shows how to create a log handle and then use `os_log_with_type` to send a message. You can view these logs using macOS's Console.app.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":null,"pypi_latest":"12.1","is_stale":null,"summary":{"python_range":"3.10–3.9","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pyobjc-framework-oslog","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pyobjc-framework-oslog","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.9,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pyobjc-framework-oslog","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pyobjc-framework-oslog","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pyobjc-framework-oslog","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pyobjc-framework-oslog","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pyobjc-framework-oslog","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pyobjc-framework-oslog","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.5,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pyobjc-framework-oslog","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pyobjc-framework-oslog","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.6,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}