-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from bullinnyc/add-logger
Add logger.
- Loading branch information
Showing
4 changed files
with
69 additions
and
11 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
Sources/CachedAsyncImage/Extensions/Extension + Logger.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// Extension + Logger.swift | ||
// CachedAsyncImage | ||
// | ||
// Created by Dmitry Kononchuk on 24.01.2024. | ||
// Copyright © 2024 Dmitry Kononchuk. All rights reserved. | ||
// | ||
|
||
import OSLog | ||
|
||
typealias Log = Logger | ||
|
||
extension Logger { | ||
// MARK: - Public Properties | ||
|
||
/// Log of failure. | ||
static let failure = Logger(subsystem: subsystem, category: "failure") | ||
|
||
// MARK: - Private Properties | ||
|
||
private static let subsystem = Bundle.module.bundleIdentifier ?? "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Emoji.swift | ||
// CachedAsyncImage | ||
// | ||
// Created by Dmitry Kononchuk on 25.01.2024. | ||
// Copyright © 2024 Dmitry Kononchuk. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
final class Emoji { | ||
// MARK: - Public Enums | ||
|
||
enum Code: String { | ||
case hammer = "1f528" | ||
} | ||
|
||
// MARK: - Public Methods | ||
|
||
static func getEmoji(from code: Code) -> String? { | ||
guard let number = Int(code.rawValue, radix: 16), | ||
let unicodeScalar = UnicodeScalar(number) | ||
else { return nil } | ||
|
||
return String(unicodeScalar) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters