Log.INFO vs. Log.DEBUG

I usually try to use it like this: DEBUG: Information interesting for Developers, when trying to debug a problem. INFO: Information interesting for Support staff trying to figure out the context of a given error WARN to FATAL: Problems and Errors depending on level of damage.

How to easily print ascii-art text?

pyfiglet – pure Python implementation of http://www.figlet.org pip install pyfiglet termcolor – helper functions for ANSI color formatting pip install termcolor colorama – multiplatform support (Windows) pip install colorama Example $ python print-warning.py | cat .___ ___. __ _______. _______. __ __ _______ __ | \/ | | | / | / || | | … Read more

Adding message to assert

You are out of luck here. The best way is to define your own assert macro. Basically, it can look like this: This will define the ASSERT macro only if the no-debug macro NDEBUG isn’t defined. Then you’d use it like this: Which is a bit simpler than your usage since you don’t need to … Read more

What is the significance of log4j.rootLogger property in log4j.properties file? What happens if I don’t use this property?

Samudra Gupta explains in his book1: The Logger object is the main object that an application developer uses to log any message. The Logger objects acting within a particular instance of an application follow a parent-child hierarchy. If you have the following configuration: This is how the logger hierarchy could end up looking:2 Samudra Gupta continues to explain: At the … Read more