You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the following patch to convert unchecked Debug to wrapped by if logging.isDebugEnabled() .
I would like to make this idempotent so it can be repeatedly applied.
How do I do that?
@@
var x expression
@@
-logging.L(x).Debug(...)+if logging.IsDebugEnabled(x) {+ logging.L(x).Debug(...)+}
The text was updated successfully, but these errors were encountered:
Hey @mandarjog, this isn't currently possible.
You basically have to undo and redo the patch to make it idempotent.
The undo catches existing variants, and the redo covers them all:
@@
var x expression
@@
-if logging.IsDebugEnabled(x) {
logging.L(x).Debug(...)
-}
@@
var x expression
@@
+if logging.IsDebugEnabled(x) {
logging.L(x).Debug(...)
+}
One of the options that was considered for the language was a ! prefix (in place of - or +) to mean "code here doesn't match this". If implemented, that could work here, although it would still require duplicating some of the patch content:
@@
var x expression
@@
+if logging.IsDebugEnabled(x) {!if logging.IsDebugEnabled(x) {
logging.L(x).Debug(...)
!}+}
I am using the following patch to convert unchecked Debug to wrapped by
if logging.isDebugEnabled()
.I would like to make this idempotent so it can be repeatedly applied.
How do I do that?
The text was updated successfully, but these errors were encountered: