Skip to content

Commit

Permalink
able to force production logging for one specific message.
Browse files Browse the repository at this point in the history
  • Loading branch information
evermeer committed Apr 30, 2019
1 parent 40c99f4 commit 08571f1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

6 changes: 4 additions & 2 deletions Source/Print/Print.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ public extension Stuff {
return "🚫"
case .fatal:
return "🆘"
case .none, .productionLogAll:
case .productionLogAll:
return "🚧"
case .none:
return ""
}
}
Expand All @@ -71,7 +73,7 @@ public extension Stuff {
let traceOutput: String = trace.map { "\t\t\($0)" }.reduce("\n") { "\($0)\n\($1)" }
let output: String = object is Error ? "\((object as! Error).localizedDescription)\(traceOutput)" : "\(object)"
let logText = "\n\(level.description()) .\(level)\(dateFormatter.string(from: Foundation.Date())) 📱 \(process.processName) [\(process.processIdentifier):\(threadId)] 📂 \(file)(\(line)) ⚙️ \(funcname) ➡️\r\t\(output)"
if Stuff.minimumLogLevel == .productionLogAll {
if Stuff.minimumLogLevel == .productionLogAll || level == .productionLogAll {
if #available(iOS 10.0, *) {
let log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Stuff")
os_log("%{public}@", log: log, logText)
Expand Down
2 changes: 1 addition & 1 deletion Stuff.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Stuff"
s.version = "1.1.1"
s.version = "1.1.2"
s.summary = "Too small for a library, too important to just forget"

s.description = <<-EOS
Expand Down
3 changes: 0 additions & 3 deletions Stuff.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 08571f1

Please sign in to comment.