Skip to content

Commit

Permalink
Merge pull request Ericsson#1633 from gyorb/dev-loglevel
Browse files Browse the repository at this point in the history
fine tune log levels and db status logging
  • Loading branch information
csordasmarton authored Jun 8, 2018
2 parents f582a03 + 513a1cd commit 968bd5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion libcodechecker/libhandlers/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ def server_init_start(args):
db_status = prod_server.connect()
if db_status != DBStatus.MISSING:
db_status = prod_server.connect(init=True)
LOG.error(database_status.db_status_msg.get(db_status))
LOG.debug(database_status.db_status_msg.get(db_status))
if db_status != DBStatus.OK:
LOG.error("Failed to configure default product")
sys.exit(1)
Expand Down
21 changes: 10 additions & 11 deletions libcodechecker/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,10 @@ def do_GET(self):
"""

auth_session = self.__check_session_cookie()
LOG.info("{0}:{1} -- [{2}] GET {3}"
.format(self.client_address[0],
str(self.client_address[1]),
auth_session.user if auth_session else 'Anonymous',
self.path))
LOG.debug("%s:%s -- [%s] GET %s", self.client_address[0],
str(self.client_address[1]),
auth_session.user if auth_session else 'Anonymous',
self.path)

if auth_session is not None:
self.auth_token = auth_session.token
Expand Down Expand Up @@ -292,8 +291,10 @@ def __check_prod_db(product):
raise ValueError(error_msg)
else:
# Send an error to the user.
db_stat = DBStatus._VALUES_TO_NAMES.get(product.db_status)
error_msg = "'{0}' database connection " \
"failed!".format(product.endpoint)
"failed. DB status: {1}".format(product.endpoint,
str(db_stat))
LOG.error(error_msg)
raise ValueError(error_msg)

Expand All @@ -304,11 +305,9 @@ def do_POST(self):

client_host, client_port = self.client_address
auth_session = self.__check_session_cookie()
LOG.info("{0}:{1} -- [{2}] POST {3}"
.format(client_host,
str(client_port),
auth_session.user if auth_session else "Anonymous",
self.path))
LOG.debug("%s:%s -- [%s] POST %s", client_host, str(client_port),
auth_session.user if auth_session else "Anonymous",
self.path)

# Create new thrift handler.
checker_md_docs = self.server.checker_md_docs
Expand Down

0 comments on commit 968bd5a

Please sign in to comment.