Simple programs print out information to the standard output or tot the standard error output. If the program gets bigger and contains many modules a lot unwanted messages might occur and something more flexible is desired to select what is required.Additionally printing on the standard output might not create a visual effect when the linux device has no display (embedded PC) or if X is running. Instead of creating something there own available loggers can be used such as:
log4cxx logger