Skip to content

Commit

Permalink
Merge pull request #1338 from csordasmarton/remove-default-loglevel
Browse files Browse the repository at this point in the history
Remove the default log level
  • Loading branch information
gyorb authored Feb 1, 2018
2 parents 943d5b1 + 73bc9e7 commit 7ae33c0
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ common arguments:
connect to. (default: localhost)
-p PORT, --port PORT The port the server is running on. (default: 8001)
--verbose {info,debug,debug_analyzer}
Set verbosity level. (default: info)
Set verbosity level.
~~~~~~~~~~~~~~~~~~~~~

The user can log in onto the server by issuing the command `CodeChecker cmd
Expand Down
2 changes: 1 addition & 1 deletion docs/products.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ common arguments:
--url SERVER_URL The URL of the server to access, in the format of
'[http[s]://]host:port'. (default: localhost:8001)
--verbose {info,debug,debug_analyzer}
Set verbosity level. (default: info)
Set verbosity level.
Most of these commands require authentication and appropriate access rights.
Please see 'CodeChecker cmd login' to authenticate.
Expand Down
18 changes: 9 additions & 9 deletions docs/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ optional arguments:
-q, --quiet Do not print the output of the build tool into the
output of this command.
--verbose {info,debug,debug_analyzer}
Set verbosity level. (default: info)
Set verbosity level.
~~~~~~~~~~~~~~~~~~~~~

Please note, that only the files that are used in the given `--build` argument
Expand Down Expand Up @@ -426,7 +426,7 @@ optional arguments:
-n NAME, --name NAME Annotate the run analysis with a custom name in the
created metadata file.
--verbose {info,debug,debug_analyzer}
Set verbosity level. (default: info)
Set verbosity level.
~~~~~~~~~~~~~~~~~~~~~

### <a name="skip"></a> _Skip_ file
Expand Down Expand Up @@ -723,7 +723,7 @@ optional arguments:
--print-steps Print the steps the analyzers took in finding the
reported defect.
--verbose {info,debug,debug_analyzer}
Set verbosity level. (default: info)
Set verbosity level.
export arguments:
-e {html}, --export {html}
Expand Down Expand Up @@ -842,7 +842,7 @@ optional arguments:
incrementally update defect reports for source files
that were analysed.)
--verbose {info,debug,debug_analyzer}
Set verbosity level. (default: info)
Set verbosity level.
server arguments:
Specifies a 'CodeChecker server' instance which will be used to store the
Expand Down Expand Up @@ -919,7 +919,7 @@ optional arguments:
The format to list the applicable checkers as.
(default: rows)
--verbose {info,debug,debug_analyzer}
Set verbosity level. (default: info)
Set verbosity level.
~~~~~~~~~~~~~~~~~~~~~

The list provided by default is formatted for easy machine and human
Expand Down Expand Up @@ -963,7 +963,7 @@ optional arguments:
-o {rows,table,csv,json}, --output {rows,table,csv,json}
Specify the format of the output list. (default: rows)
--verbose {info,debug,debug_analyzer}
Set verbosity level. (default: info)
Set verbosity level.
~~~~~~~~~~~~~~~~~~~~~

A detailed view of the available analyzers is available via `--details`. In the
Expand Down Expand Up @@ -1024,7 +1024,7 @@ optional arguments:
--skip-db-cleanup Skip performing cleanup jobs on the database like
removing unused files.
--verbose {info,debug,debug_analyzer}
Set verbosity level. (default: info)
Set verbosity level.
configuration database arguments:
--sqlite SQLITE_FILE Path of the SQLite database file to use. (default:
Expand Down Expand Up @@ -1248,7 +1248,7 @@ common arguments:
The output format to use in showing the data.
(default: plaintext)
--verbose {info,debug,debug_analyzer}
Set verbosity level. (default: info)
Set verbosity level.
~~~~~~~~~~~~~~~~~~~~~

### <a name="cmd-runs"></a> List runs (`runs`)
Expand Down Expand Up @@ -1487,7 +1487,7 @@ optional arguments:
common arguments:
--verbose {info,debug,debug_analyzer}
Set verbosity level. (default: info)
Set verbosity level.
~~~~~~~~~~~~~~~~~~~~~

If a server [requires privileged access](authentication.md), you must
Expand Down
15 changes: 7 additions & 8 deletions libcodechecker/cmd/cmd_line_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def add_filter_conditions(report_filter, filter_str):

def handle_list_runs(args):

init_logger(args.verbose)
init_logger(args.verbose if 'verbose' in args else None)

client = setup_client(args.product_url)
runs = client.getRunData(None)
Expand All @@ -145,8 +145,7 @@ def handle_list_runs(args):


def handle_list_results(args):

init_logger(args.verbose)
init_logger(args.verbose if 'verbose' in args else None)

client = setup_client(args.product_url)

Expand Down Expand Up @@ -195,7 +194,7 @@ def handle_list_results(args):

def handle_diff_results(args):

init_logger(args.verbose)
init_logger(args.verbose if 'verbose' in args else None)

context = generic_package_context.get_context()

Expand Down Expand Up @@ -591,7 +590,7 @@ def print_reports(client, reports, output_format):

def handle_list_result_types(args):

init_logger(args.verbose)
init_logger(args.verbose if 'verbose' in args else None)

def get_statistics(client, run_ids, field, values):
report_filter = ttypes.ReportFilter()
Expand Down Expand Up @@ -718,7 +717,7 @@ def checker_count(checker_dict, key):

def handle_remove_run_results(args):

init_logger(args.verbose)
init_logger(args.verbose if 'verbose' in args else None)

client = setup_client(args.product_url)

Expand Down Expand Up @@ -768,7 +767,7 @@ def condition(name, runid, date):

def handle_suppress(args):

init_logger(args.verbose)
init_logger(args.verbose if 'verbose' in args else None)

def bug_hash_filter(bug_id, filepath):
filepath = '%' + filepath
Expand Down Expand Up @@ -799,7 +798,7 @@ def bug_hash_filter(bug_id, filepath):

def handle_login(args):

init_logger(args.verbose)
init_logger(args.verbose if 'verbose' in args else None)

protocol, host, port = split_server_url(args.server_url)
handle_auth(protocol, host, port, args.username,
Expand Down
6 changes: 3 additions & 3 deletions libcodechecker/cmd/product_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def init_logger(level, logger_name='system'):

def handle_list_products(args):

init_logger(args.verbose)
init_logger(args.verbose if 'verbose' in args else None)

protocol, host, port = split_server_url(args.server_url)
client = setup_product_client(protocol, host, port)
Expand Down Expand Up @@ -67,7 +67,7 @@ def handle_list_products(args):

def handle_add_product(args):

init_logger(args.verbose)
init_logger(args.verbose if 'verbose' in args else None)

protocol, host, port = split_server_url(args.server_url)
client = setup_product_client(protocol, host, port)
Expand Down Expand Up @@ -119,7 +119,7 @@ def handle_add_product(args):

def handle_del_product(args):

init_logger(args.verbose)
init_logger(args.verbose if 'verbose' in args else None)

protocol, host, port = split_server_url(args.server_url)
client = setup_product_client(protocol, host, port)
Expand Down
2 changes: 1 addition & 1 deletion libcodechecker/libhandlers/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def main(args):
Perform analysis on the given logfiles and store the results in a machine-
readable format.
"""
logger.setup_logger(args.verbose)
logger.setup_logger(args.verbose if 'verbose' in args else None)

if len(args.logfile) != 1:
LOG.warning("Only one log file can be processed right now!")
Expand Down
2 changes: 1 addition & 1 deletion libcodechecker/libhandlers/analyzers.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def main(args):
"""
List the analyzers' basic information supported by CodeChecker.
"""
logger.setup_logger(args.verbose)
logger.setup_logger(args.verbose if 'verbose' in args else None)

context = generic_package_context.get_context()
working, errored = \
Expand Down
2 changes: 1 addition & 1 deletion libcodechecker/libhandlers/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def main(args):
Execute a wrapper over log-analyze-parse, aka 'check'.
"""

logger.setup_logger(args.verbose)
logger.setup_logger(args.verbose if 'verbose' in args else None)

def __load_module(name):
"""Loads the given subcommand's definition from the libs."""
Expand Down
2 changes: 1 addition & 1 deletion libcodechecker/libhandlers/checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def main(args):
alongside with their description or enabled status in various formats.
"""

logger.setup_logger(args.verbose)
logger.setup_logger(args.verbose if 'verbose' in args else None)

# If nothing is set, list checkers for all supported analyzers.
analyzers = args.analyzers \
Expand Down
2 changes: 1 addition & 1 deletion libcodechecker/libhandlers/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def main(args):
Generates a build log by running the original build command.
No analysis is done.
"""
logger.setup_logger(args.verbose)
logger.setup_logger(args.verbose if 'verbose' in args else None)

args.logfile = os.path.realpath(args.logfile)
if os.path.exists(args.logfile):
Expand Down
2 changes: 1 addition & 1 deletion libcodechecker/libhandlers/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def main(args):
stdout in a human-readable format.
"""

logger.setup_logger(args.verbose)
logger.setup_logger(args.verbose if 'verbose' in args else None)

context = generic_package_context.get_context()

Expand Down
2 changes: 1 addition & 1 deletion libcodechecker/libhandlers/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,5 +860,5 @@ def main(args):
Setup a logger server based on the configuration and
manage the CodeChecker server.
"""
with logger.LOG_CFG_SERVER(args.verbose):
with logger.LOG_CFG_SERVER(args.verbose if 'verbose' in args else None):
server_init_start(args)
2 changes: 1 addition & 1 deletion libcodechecker/libhandlers/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def main(args):
Store the defect results in the specified input list as bug reports in the
database.
"""
logger.setup_logger(args.verbose)
logger.setup_logger(args.verbose if 'verbose' in args else None)

if not host_check.check_zlib():
raise Exception("zlib is not available on the system!")
Expand Down
2 changes: 1 addition & 1 deletion libcodechecker/libhandlers/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def main(args):
Get and print the version information from the version config
file and Thrift API definition.
"""
logger.setup_logger(args.verbose)
logger.setup_logger(args.verbose if 'verbose' in args else None)

context = generic_package_context.get_context()

Expand Down
3 changes: 2 additions & 1 deletion libcodechecker/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""
"""

import argparse
import json
import logging
from logging import config
Expand Down Expand Up @@ -91,7 +92,7 @@ def add_verbose_arguments(parser):
"""
parser.add_argument('--verbose', type=str, dest='verbose',
choices=CMDLINE_LOG_LEVELS,
default='info',
default=argparse.SUPPRESS,
help='Set verbosity level.')


Expand Down

0 comments on commit 7ae33c0

Please sign in to comment.