Skip to content

Commit 43d58ea

Browse files
Mark Pospeselmpospese
authored andcommitted
[CM-604] Use Logger not print
1 parent bab234a commit 43d58ea

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Sources/YMatterType/Typography/FontRepresentable.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,24 @@ public protocol FontRepresentable {
5656
func accessibilityBoldWeight(for weight: Typography.FontWeight) -> Typography.FontWeight
5757
}
5858

59+
extension Typography {
60+
fileprivate static let logger = Logger(subsystem: "YMatterType", category: "fonts")
61+
}
62+
5963
// MARK: - Default implementations
6064

6165
extension FontRepresentable {
6266
public var fontNameSuffix: String { "" }
63-
67+
6468
public func font(
6569
for weight: Typography.FontWeight,
6670
pointSize: CGFloat,
6771
compatibleWith traitCollection: UITraitCollection?
6872
) -> UIFont {
6973
let name = fontName(for: weight, compatibleWith: traitCollection)
7074
guard let font = UIFont(name: name, size: pointSize) else {
71-
// Fallback to system font
72-
print("Custom font \(name) not properly installed")
75+
// Fallback to system font and log a message.
76+
Typography.logger.warning("Custom font \(name) not properly installed.")
7377
return FontInfo.system.font(
7478
for: weight,
7579
pointSize: pointSize,

0 commit comments

Comments
 (0)