lcc logging related queries

13 views
Skip to first unread message

Akshay Maldhure

unread,
Jan 17, 2020, 1:18:34 AM1/17/20
to lemoncheesecake
console reporting:

As per this page http://docs.lemoncheesecake.io/en/latest/installation.html, the console reporting backend is available by default. So by default, when I do something like lcc.log_info("some message"), why does "some message" get logged to the HTML report only and not to console?

customising lcc logger:

Is it feasible to customise the lcc logger so that it prints only info level logs (done with lcc.log_info()) to console and all the levels including info to the HTML report?

Nicolas Delon

unread,
Jan 18, 2020, 3:44:03 PM1/18/20
to lemoncheesecake
Hello Akshay,

The console reporting backend aims to show a summary of the test execution state. It would be difficult to show more information in a readable way, especially when tests are parallelized (with "--threads N" where N > 1).

So, no, it is not currently feasible to show logs through the console reporting backend and more generally, not the philosophy of this reporting backend.

Best regards,

Nicolas.

Akshay Maldhure

unread,
Jan 28, 2020, 4:16:50 AM1/28/20
to lemoncheesecake
Hi Nicolas,

Is there any other cleaner way to achieve it? I really do not want to write the print() statements along with lcc logger statements. Moreover, I believe, it would make much more sense to have this functionality baked into lcc's logger instead of using a third-party logger with lcc. This would also make lcc stand out from most other testing frameworks out there.

Do let me know your thoughts on this.

Nicolas Delon

unread,
Jan 28, 2020, 5:02:10 PM1/28/20
to lemoncheesecake
Hello Akshay,

As I told previously, your needs seem to be very specific and not fit all in how things work today.
Could you make a visual example of what you have in mind, just to make sure that I properly understood what you want ?

Best regards,

Nicolas.

Akshay Maldhure

unread,
Jan 28, 2020, 7:50:11 PM1/28/20
to lemoncheesecake
Well, I'm seeing to use lcc's logger just like people use logging libraries like log4j2 with a Java-based project. Logging is a very common need for any test framework; what I'm asking is an extension to the default behavior. In fact, a good test framework should have configurable logging. I'm not sure how's that a special need. It can be seen that lcc's documentation lists different logging backends like console, slack, html, etc. What seems to be weird though is that not all the logs go to console unlike html.

Nicolas Delon

unread,
Jan 29, 2020, 5:10:49 PM1/29/20
to lemoncheesecake
Logs in lemoncheesecake are structured and inside a test, they tell a kind of story as a whole. They are meaningful together, not individually. Each reporting backend fills a different need and adapts to a specific media. The purpose of the console reporting backend is to provide a clean summary , easy so read of what's going on, what test succeed, what test failed, an information that you won't never see among thousands of lines. The HTML report uses a media that allows rich user interactions: listing tests with their main information and when you click on a specific test, you can see what happened in the test. This is not something you can achieve in a console output.

On the other side, I have a feature in mind for while, where the lemoncheesecake "logger" (meaning: lcc.log_info, lcc.log_error, etc...) could be also used as a Python logging handler (https://docs.python.org/3.8/library/logging.html#handler-objects).
In that case, you could probably do what you looking for after proper logging configuration and using the Python logging module instead of direct calls to lcc.log_info().

I'll keep you updated.

Akshay Maldhure

unread,
Jan 29, 2020, 8:24:02 PM1/29/20
to lemoncheesecake
Thanks Nicolas for elaborating the objective of the lcc logger. It was useful for me to understand the same.

Like you said, I would like to see how lcc logger could be used as a Python logger in future.

Thanks once again!

Reply all
Reply to author
Forward
0 new messages