Repository: ranger
Updated Branches:
  refs/heads/master 5da7000f8 -> d02cdaee6


RANGER-1941:Use already defined methods and optimized log printing in 
RangerScriptExecutionContext class

Signed-off-by: peng.jianhua <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/d02cdaee
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/d02cdaee
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/d02cdaee

Branch: refs/heads/master
Commit: d02cdaee6069f5ae350115f46543f7c2da00e4f5
Parents: 5da7000
Author: peng.jianhua <[email protected]>
Authored: Thu Dec 21 10:57:59 2017 +0800
Committer: peng.jianhua <[email protected]>
Committed: Thu Jan 4 10:58:35 2018 +0800

----------------------------------------------------------------------
 .../conditionevaluator/RangerScriptExecutionContext.java     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/d02cdaee/agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
----------------------------------------------------------------------
diff --git 
a/agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
 
b/agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
index 0c8df41..c3ed240 100644
--- 
a/agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
+++ 
b/agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
@@ -163,7 +163,7 @@ public final class RangerScriptExecutionContext {
                        ret = (RangerTagForEval)val;
                } else {
                        if (LOG.isDebugEnabled()) {
-                               LOG.debug("getCurrentTag() - No current TAG 
object. Script execution must be for resource-based policy.");
+                               
logDebug("RangerScriptExecutionContext.getCurrentTag() - No current TAG object. 
Script execution must be for resource-based policy.");
                        }
                }
                return ret;
@@ -285,7 +285,7 @@ public final class RangerScriptExecutionContext {
                                ret = getAsDate(value, simpleDateFormat);
                                if (ret != null) {
                                        if (LOG.isDebugEnabled()) {
-                                               LOG.debug("The best match found 
for Format-String:[" + simpleDateFormat.toPattern() + "], date:[" + ret +"]");
+                                               
logDebug("RangerScriptExecutionContext.getAsDate() -The best match found for 
Format-String:[" + simpleDateFormat.toPattern() + "], date:[" + ret +"]");
                                        }
                                        break;
                                }
@@ -293,7 +293,7 @@ public final class RangerScriptExecutionContext {
                }
 
                if (ret == null) {
-                       LOG.error("RangerScriptExecutionContext.getAsDate() - 
Could not convert [" + value + "] to Date using any of the Format-Strings: " + 
Arrays.toString(dateFormatStrings));
+                       logError("RangerScriptExecutionContext.getAsDate() - 
Could not convert [" + value + "] to Date using any of the Format-Strings: " + 
Arrays.toString(dateFormatStrings));
                } else {
                        ret = StringUtil.getUTCDateForLocalDate(ret);
                }
@@ -361,7 +361,7 @@ public final class RangerScriptExecutionContext {
                        if (LOG.isDebugEnabled()) {
                                String resource = 
accessRequest.getResource().getAsString();
 
-                               LOG.debug("getAllTags() - No TAGS. No TAGS for 
the RangerAccessResource=" + resource);
+                               
logDebug("RangerScriptExecutionContext.getAllTags() - No TAGS. No TAGS for the 
RangerAccessResource=" + resource);
                        }
                }
 

Reply via email to