Skip to content

Instantly share code, notes, and snippets.

View udaybhaskar-v's full-sized avatar

Uday Bhaskar udaybhaskar-v

  • Bangalore
View GitHub Profile
xdg-mime default "your File Explorer Name".desktop inode/directory
@udaybhaskar-v
udaybhaskar-v / IntellijLiveTemplates
Last active December 7, 2022 12:56
Autogenerate logger statements using live templates.
<templateSet group="Log4j">
<template name="log4j" value="private final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(getClass());" description="log4j declaration" toReformat="true" toShortenFQNames="true">
<context>
<option name="JAVA_DECLARATION" value="true" />
</context>
</template>
<template name="log4d" value="$LOGGER_VAR$.debug(&quot;$EXPR_COPY$ = &quot; + $EXPR$);" description="log4j debug statement" toReformat="true" toShortenFQNames="true">
<variable name="LOGGER_VAR" expression="variableOfType(&quot;org.apache.log4j.Logger&quot;)" defaultValue="" alwaysStopAt="false" />
<variable name="EXPR_COPY" expression="escapeString(EXPR)" defaultValue="" alwaysStopAt="true" />
<variable name="EXPR" expression="variableOfType(&quot;&quot;)" defaultValue="" alwaysStopAt="true" />