You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Lars George (JIRA)" <ji...@apache.org> on 2011/05/26 14:42:47 UTC

[jira] [Issue Comment Edited] (HBASE-3925) Make Shell's -d and debug cmd behave the same

    [ https://issues.apache.org/jira/browse/HBASE-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039685#comment-13039685 ] 

Lars George edited comment on HBASE-3925 at 5/26/11 12:42 PM:
--------------------------------------------------------------

Also fix the initial flag when using the -d option. Currently we have this:

{noformat}
$ bin/hbase shell -d
Setting DEBUG log level...
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.91.0-SNAPSHOT, r1127782, Thu May 26 10:28:47 CEST 2011

hbase(main):001:0> debug?
Debug mode is OFF
{noformat}

No biggie, but inconsistent nevertheless.

      was (Author: larsgeorge):
    Also fix the initial flag when using the -d option. Currently we have this:

{noformat}
$ bin/hbase shell -d
debuSetting DEBUG log level...
gHBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.91.0-SNAPSHOT, r1127782, Thu May 26 10:28:47 CEST 2011

hbase(main):001:0> debug?
Debug mode is OFF
{noformat}

No biggie, but inconsistent nevertheless.
  
> Make Shell's -d and debug cmd behave the same
> ---------------------------------------------
>
>                 Key: HBASE-3925
>                 URL: https://issues.apache.org/jira/browse/HBASE-3925
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.90.3
>            Reporter: Lars George
>            Priority: Trivial
>             Fix For: 0.90.4, 0.92.0
>
>
> The -d option switches log4j to DEBUG and leaves the backtrace level at the default. When using the supplied debug command we only switch the backtrace, but I would think this also should set the log4j levels:
> {noformat}
> # Debugging method
> def debug
>   if @shell.debug
>     @shell.debug = false
>     conf.back_trace_limit = 0
>   else
>     @shell.debug = true
>     conf.back_trace_limit = 100
>   end
>   debug?
> end
> {noformat}
> could be something like 
> {noformat}
> # Debugging method
> def debug
>   if @shell.debug
>     @shell.debug = false
>     conf.back_trace_limit = 0
>     log_level = org.apache.log4j.Level::ERROR
>   else
>     @shell.debug = true
>     conf.back_trace_limit = 100
>     log_level = org.apache.log4j.Level::DEBUG
>   end
>   org.apache.log4j.Logger.getLogger("org.apache.zookeeper").setLevel(log_level)
>   org.apache.log4j.Logger.getLogger("org.apache.hadoop.hbase").setLevel(log_level)
>   debug?
> end
> {noformat}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira