Skip to content

Instantly share code, notes, and snippets.

@Crydust
Created July 28, 2015 09:39
Show Gist options
  • Save Crydust/f4bb2fd1ba00c180e770 to your computer and use it in GitHub Desktop.
Save Crydust/f4bb2fd1ba00c180e770 to your computer and use it in GitHub Desktop.
convert System.out to slf4j
System\.out\.printf\("([^%]*?)%s([^%]*?)%n"(,[^,]*?)\);
logger.info("$1{}$2"$3);
System\.out\.println\((".*?")\);
logger.info($1);
System\.out\.printf\((".*?",.*?)\);
logger.info(String.format($1));
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
private static final Logger logger = LoggerFactory.getLogger(Example.class);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment