CS agents will respond to tickets via forum instead of private helpdesk to support other users with similar issues.

unable to print message in Log Viewer

I am trying to print message on Log Viewer using print, println, sysout but nothing is working. It prints the statement itself rather rather printing message.

Comments

  • Thank you so much

  • Hi, use following instance:

    KeywordLogger log = new KeywordLogger()
    log.logInfo("yourMsg")
    

    You can also use logFailed, logWarning, etc.

  • pkpk
    edited October 11

    this shows error

    unable to resolve class KeywordLogger
    @ line 65, column 15.
    KeywordLogger log = new KeywordLogger()
    ^

  • Sorry, forgot to attach import line:

    import com.kms.katalon.core.logging.KeywordLogger

    Next time, you can autocomplete imports clicking Ctrl+Shift+O

  • I did try but no luck
    println ("Login Test Failed")
    println("Second message");
    KeywordLogger log = new KeywordLogger()
    log.logInfo("yourMsg")

  • Adhay,

    which version of Katalon Studio are you using? There are some options to print out the log to LogView. Please have a look at below example:

  • @Marek Melocik said:
    Hi, use following instance:

    KeywordLogger log = new KeywordLogger()
    log.logInfo("yourMsg")
    

    You can also use logFailed, logWarning, etc.

    it works as intended. thanks

Sign In or Register to comment.