Skip to content

Commit

Permalink
OSS-68 Adding Logger to MisoGlobalInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
sakamura committed Dec 24, 2020
1 parent 625f6cc commit 486630e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Instead of searching everywhere for the most used variables, these are provided
- App store receipt retrieval: `GlobalInfo.App.appStoreReceiptURL`, `GlobalInfo.App.hasAppStoreReceipt` and `GlobalInfo.App.appStoreReceipt`
- identifierForVendor's UUID retrieval (not for advertisements): `GlobalInfo.OS.uuid`

### macOS 11 / iOS 14 Logger support

- Defines the `subsystem` as the `bundleIdentifier` automatically. Simply create your logger with the category: `Logger(category: "SomeCategory")`

## Colophon

Expand Down
19 changes: 19 additions & 0 deletions Sources/MisoGlobalInfo/Logger+bundleIdentifier.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// MisoGlobalInfo.swift
// MisoGlobalInfo
//
// Created by Michel Donais on 2020-12-24.
// Copyright © 2019-2020 Misoservices Inc. All rights reserved.
// [BSL-1.0] This package is Licensed under the Boost Software License - Version 1.0
//


import os

@available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
public extension Logger {
init(category: String) {
self.init(subsystem: GlobalInfo.App.bundleIdentifier ?? "No bundleIdentifier",
category: category)
}
}

0 comments on commit 486630e

Please sign in to comment.