All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.java.rules.squid.S106.html Maven / Gradle / Ivy

Two important requirements must be fulfilled when logging messages:

  • The user must be able to easily retrieve the logs.
  • The format of all messages must be uniform to enable users to easily browse them.

If a program directly writes to the standard output, there is absolutely no way to comply with these requirements. That's why defining and using a dedicated logger is highly recommended.

The following code snippet illustrates this rule:

System.out.println("My Message");  // Non-Compliant

logger.log("My Message");          // Compliant




© 2015 - 2025 Weber Informatics LLC | Privacy Policy