Android Question How to print out the method name and line number?

Discussion in 'Android Questions' started by Rabbit, Mar 9, 2015.

  1. Rabbit

    Rabbit Member Licensed User


    When I debug my app in the end user device I need to log functions activities in FILE.LOG for debugging

    How to print out the method name and line number?

    In this case I need to insert customized function such as :

    APPEND("FILE.LOG", "GetSqlRow")

    is there built in function gives me the reflected current line code in the B4A?

    APPEND("FILE.LOG", "GetSqlRow", GetCurrentLineCode)


    NSLog(@"%s %d %s %s", __FILE__, __LINE__, __PRETTY_FUNCTION__, __FUNCTION__);
    file name, line number, and function name:
    121 managedObjectContext managedObjectContext
    in C++ shows mangled name __PRETTY_FUNCTION__ shows nice function name, in cocoa they look the same.

    Thank you.
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Rabbit

    Rabbit Member Licensed User

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice