Cleaning up output from Console

This is a question pertaining to prints from com.kms packages on the Console (not Log Viewer).

Is there any way to remove the timestamps from KeywordUtil or other Katalon methods in the Console, but keep the rest of the information (Similar to the question asked in this thread.). I’m finding that it’s difficult to see println statements in the Console when used alongside KeywordUtil and other com.kms logging.

Also bonus questions (I can make a new topic for these if needed):

  1. Can we control if println appears on the Log Viewer, or is that locked to com.kms methods like KeyWordUtil only? What determines if something gets displayed on the Log Viewer?
  2. I find that the Console cuts off after a certain number of lines. Can we view the entirety of Console Logs, or at least view the log file in our filesystem?

Reason:

In our team we have a mix of printing strategies. We have one utilizing println because it offers better type compatibility than KeywordUtil, and we find it easier to read on our server tests. The other utilizes KeywordUtil to use the Log Viewer for very long scripts (because Katalon cuts the regular Console off).

  1. Can we control if println appears on the Log Viewer,

No, I don’t think it is possible.

or is that locked to com.kms methods like KeyWordUtil only?

Yes, almost.

What determines if something gets displayed on the Log Viewer?

com.kms.katalon.core.util.KeywordUtil calls com.kms.katalon.core.logging.KeywordLogger, where you can find ultimately org.slf4j.Logger is used.The LogViewer in the KS GUI seems displaying the logs recorded through the SLF4J logging infrastructure. Therefore, any output through System.out.println does not come up to the LogViewer. I believe KS uses the Logback as an implementation backing the SLF4J interface.

  1. I find that the Console cuts off after a certain number of lines. Can we view the entirety of Console Logs, or at least view the log file in our filesystem?

Please have a look at my previous posts.

There is a way for you. You can write a Custom Keyword that modifies the LogBack configuration dynamically. If you do it, you can customize the logging behavior of KS runtime.

It is a hard practice, easily broken, difficult to keep stable. I suppose that Katalon Team is reluctant to offer a feature of customizing LogBack configuration due to the same reason. If a less-skillful user break the logging feature in KS, he/she can not debug it at all because no log is visible.

As far as I see, KS is a product oriented for beginners and novices, not for programming experts. So I would not stick to the customization offering too much. If I personally want to, I can make it anyway…

1 Like

@devalex88 once replied a positive response:

However he is not here in the forum any longer, as this tells

@duyluong @ThanhTo

Are you aware of this issue? Any comment?

1 Like

Thanks for all of your help, @kazurayam. It’s really insightful and really helpful (because it’s pretty hard to find this information). I’m also interested in what devs think about this, as it’s something everyone that uses the software interacts with.

I’ll review those posts you linked. Thanks again!