> On May 20, 2015, 5:23 a.m., Amareshwari Sriramadasu wrote:
> > I'm thinking, shall we make --verbose at lens-cli option, which initializes 
> > logger to console (if verbose is on) or to a file (otherwise). That would 
> > make logging available for all commands and we should not require passing 
> > verbose flag around and check for flag for logging allover.
> 
> Amareshwari Sriramadasu wrote:
>     I meant while opening 
>     $lens-cli  // can open in verbose loggind mode i.e. logging on console
>     $lens-cli --quiet // can open in quiet logging mode i.e. no log on 
> console.
> 
> Rajat Khandelwal wrote:
>     +1.
> 
> Himanshu Gahlaut wrote:
>     would completely agree to the fact that passing verbose flag to functions 
> is a less optimal approach. Will try to post a suggestion soon.

Another approach could be to change the logging level of cliLogger 
programmatically to DEBUG from INFO. This can be done at only one place in 
BaseLensCommand#beforeInvocation method which intercepts all commands. We can 
log everything we want to display at DEBUG Level and keep ConsoleAppender's 
Threshold at INFO level in file. The file appender can have its own Threshold 
for logging as per its need.


- Himanshu


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


On May 20, 2015, 4:48 a.m., Raju Bairishetti wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34457/
> -----------------------------------------------------------
> 
> (Updated May 20, 2015, 4:48 a.m.)
> 
> 
> Review request for lens and Amareshwari Sriramadasu.
> 
> 
> Bugs: LENS-25
>     https://issues.apache.org/jira/browse/LENS-25
> 
> 
> Repository: lens
> 
> 
> Description
> -------
> 
> Added a cli logger for showing the query execution status
> Added a verbose option
> 
> 
> Diffs
> -----
> 
>   lens-cli/src/main/java/org/apache/lens/cli/commands/LensQueryCommands.java 
> 920ba9c 
>   lens-cli/src/test/java/org/apache/lens/cli/TestLensQueryCommands.java 
> a48734a 
>   lens-client/src/main/java/org/apache/lens/client/LensClient.java 016e4ab 
>   lens-client/src/main/java/org/apache/lens/client/LensStatement.java 5ce3a82 
>   tools/conf/client/log4j.properties 5520304 
> 
> Diff: https://reviews.apache.org/r/34457/diff/
> 
> 
> Testing
> -------
> 
> Tested on cli
> 
> **Enable logging by settign verbose value to true (by default to true)**
> 
> **lens-shell>query execute cube select product_details.category, store_sales 
> from sales where time_range_in(order_time, '2015-04-11-00', '2015-04-13-01') 
> --verbose true**
> 2015-05-20 08:42:05,563 [      LensStatement.java:Spring Shell:227] - Query 
> org.apache.lens.api.query.LensQuery@58dd5a16 submitted to HiveDriver
> 2015-05-20 08:42:15,510 [      LensStatement.java:Spring Shell:232] - 
> RUNNING:Query is running in HiveServer! - 
> Progress:0.3333333432674408:[{"taskId":"Stage-5","type":"MAPREDLOCAL","externalHandle":"Stage-5","taskState":"FINISHED_STATE"},{"taskId":"Stage-2","type":"MAPRED","externalHandle":null,"taskState":"RUNNING_STATE"},{"taskId":"Stage-0","type":"MOVE","externalHandle":"Stage-0","taskState":"UNKNOWN_STATE"}]
> 2015-05-20 08:42:25,561 [      LensStatement.java:Spring Shell:232] - 
> SUCCESSFUL:Query is successful! - Result Available
> product_details.category    _c1    
> Results of query stored at : 
> file:/tmp/lensreports/hdfsout/256d4c84-496c-49e8-993c-3d8b8f0451a5 -1 rows 
> process in (27) seconds.
> 
> **Disable logging by setting verbose value to false (by default to true)**
> lens-shell>query execute cube select sample_dim.name, sample_dim2.name from 
> sample_dim where sample_dim.name != 'first' --verbose false
> sample_dim.name    sample_dim2.name    
> Results of query stored at : 
> file:/tmp/lensreports/hdfsout/a6abe7e3-e398-4c47-916c-80ab80c49c0b -1 rows 
> process in (8) seconds.
> 
> 
> Thanks,
> 
> Raju Bairishetti
> 
>

Reply via email to