blob: 95c78147f53a6250791dc636a211fb272117e803 [file] [log] [blame]
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Logging optinos to support cros_gestures
Setup logging options and global debug variable used by underlying
gsutil and boto libraries.
import logging
import cros_gestures_constants
class NoLoggingFilter(logging.Filter):
"""Used to filter logging messages. This completely blocks messages."""
def filter(self, record):
return False
def SetupLogging(options):
"""Initialize logging options."""
if options.detaileddebugout or options.debugout:
logging_level = logging.DEBUG
if options.detaileddebugout:
cros_gestures_constants.debug = 3 # from gsutil show httplib headers
cros_gestures_constants.debug = 2 # from gsutil
logging_level = logging.INFO
# Mute verbose oauth logging.
oauth_log = logging.getLogger('oauth2_client')