-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4732/#review7285
-----------------------------------------------------------



/trunk/src/java/org/apache/hcatalog/common/HCatUtil.java
<https://reviews.apache.org/r/4732/#comment16079>

    I see this piece of code all over the place, where we instantiate 
LoggerFactory.getLogger with the class name that's instantiating the Logger. 
It's good that each logger is class-zoned, but I'm not too happy about needing 
to call it with that class name in each class.
    
    In the past, this has caused issues when we've copy-pasted code to another 
class, for example, and not noticed that the class name of the logger needed to 
be changed. So one suggestion I'd have is to make a util method called 
getLogger() or somesuch which instantiates the Logger. I understand that the 
problem with that is that everything will seem to have come from the class that 
contained getLogger, but that is easily solved by having it do the following : 
Create a new exception, and go 1 step up the stack trace. Find the class name 
associated with that, and that's your calling class. Now use that class to 
instantiate the logger, and return.


- Sushanth


On 2012-04-26 21:31:21, Vandana Ayyalasomayajula wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4732/
> -----------------------------------------------------------
> 
> (Updated 2012-04-26 21:31:21)
> 
> 
> Review request for hcatalog, Sushanth Sowmyan, Francis Liu, and Thomas.
> 
> 
> Summary
> -------
> 
> We need to do the following things:
> 
> + Use log4j across the board
> + Introduce a class with methods to help logging, refactoring away the bunch 
> of these functions in HCatUtil right now
> + Instrument debug logging with isLogEnabled checks on the log level
> + remove all instances of commented code whose purpose was for debug logs
> 
> 
> This addresses bug hcatalog-68.
>     https://issues.apache.org/jira/browse/hcatalog-68
> 
> 
> Diffs
> -----
> 
>   /trunk/ivy.xml 1331003 
>   
> /trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
>  1331003 
>   /trunk/src/java/org/apache/hcatalog/common/HCatUtil.java 1331003 
>   /trunk/src/java/org/apache/hcatalog/data/HCatRecordObjectInspector.java 
> 1331003 
>   
> /trunk/src/java/org/apache/hcatalog/data/HCatRecordObjectInspectorFactory.java
>  1331003 
>   /trunk/src/java/org/apache/hcatalog/data/HCatRecordSerDe.java 1331003 
>   /trunk/src/java/org/apache/hcatalog/data/JsonSerDe.java 1331003 
>   
> /trunk/src/java/org/apache/hcatalog/mapreduce/DefaultOutputCommitterContainer.java
>  1331003 
>   /trunk/src/java/org/apache/hcatalog/mapreduce/HCatRecordReader.java 1331003 
>   /trunk/src/java/org/apache/hcatalog/mapreduce/HCatSplit.java 1331003 
>   /trunk/src/java/org/apache/hcatalog/mapreduce/InitializeInput.java 1331003 
>   /trunk/src/test/org/apache/hcatalog/data/HCatDataCheckUtil.java 1331003 
>   /trunk/src/test/org/apache/hcatalog/data/TestJsonSerDe.java 1331003 
> 
> Diff: https://reviews.apache.org/r/4732/diff
> 
> 
> Testing
> -------
> 
> Unit tests pass. Log messages verified from test logs.
> 
> 
> Thanks,
> 
> Vandana
> 
>

Reply via email to