priore

Print stack trace just with classes names and method names

Feb 1st, 2019
190
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Print stack trace just with classes names and method names
  2.  
  3.     private func printDebugStackTrace(fname: String? = nil) {
  4.         let stackSymbols = Thread.callStackSymbols
  5.         stackSymbols.forEach {
  6.             let components = $0.replacingOccurrences(
  7.                 of: "[A-Z]{1,1}\\d{1,2}|\\s+|yy+|SSS+",
  8.                 with: " ",
  9.                 options: .regularExpression,
  10.                 range: nil).components(separatedBy: " ")
  11.             if components[3] == "$", components.count > 5, components[5] != "UWImage" {
  12.                 debugPrint("Class \(components[5]).\(components[6])".trim())
  13.             }
  14.         }
  15.     }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×