Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //___FILEHEADER___
- import Foundation
- // To use this as a template, do the following:
- // 1. Create the 'Custom' directory -> mkdir -p ~/Library/Developer/Xcode/Templates/File\ Templates/Custom
- // 2. Open Finder, CMD + G into this directory /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates
- // 3. Open 'Source' directory and copy the Swift File.xctemplate
- // 4. Paste the Swift File.xctemplate into to the 'Custom' directory from step 1
- // 5. Rename the Swift File.xctemplate in the 'Custom' directory to the desired name for the template
- // 6. Replace the '___FILEBASENAME___.swift' file in template directory with this file
- // 7. Alternatively, edit the '___FILEBASENAME___.swift' to suit your needs
- // This helper class is helpful for when the debugging output produced by the programmer is buried by the debugging output from the system.
- // To see programmer debugging output only, do the following:
- // 1. Use this Logger's log functions
- // 2. Type [the name of your project] in the console pane (debug area) bottom-right filter.
- class Logger {
- private init () {}
- private static let project : String = "___PROJECTNAME___"
- static func log(_ string: String, label: String = "INFO"){
- DispatchQueue.main.async {
- print("[\(Logger.project)][\(label)]: \(string)")
- }
- }
- static func info(_ string: String) {
- Logger.log(string)
- }
- static func warning(_ string: String) {
- Logger.log(string, label: "WARNING")
- }
- static func error(_ string: String) {
- Logger.log(string, label: "ERROR")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement