Logging Method signature using swift

Special literals in swift are as follows (from [the swift guide]

#file String The name of the file in which it appears.

#line Int The line number on which it appears.

#column Int The column number in which it begins.

#function String The name of the declaration in which it appears.


Prior to Swift 2.2b4, these were

(https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html)):

__FILE__ String The name of the file in which it appears.

__LINE__ Int The line number on which it appears.

__COLUMN__ Int The column number in which it begins.

__FUNCTION__ String The name of the declaration in which it appears.

You can use these in logging statements like so:

println("error occurred on line \(__LINE__) in function \(__FUNCTION__)")

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)