Module Expr Str Import alias Import alias Import alias Import alias Assign NameStore Num Assign NameStore Num FunctionDef arguments args defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Str If NameLoad body Assign NameStore AttributeLoad NameLoad attr Print Str orelse Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword Str keyword Str keyword Call NameLoad keyword Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad Call AttributeLoad NameLoad attr Str attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad Call AttributeLoad NameLoad attr Str attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad Call AttributeLoad NameLoad attr Str attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If NameLoad body Expr Call AttributeLoad Call AttributeLoad NameLoad attr Str attr Str NameLoad NameLoad orelse Expr Call AttributeLoad Call AttributeLoad NameLoad attr Str attr NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr If BoolOpAnd UnaryOpNot AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call NameLoad BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A Common logging setup and utility functions. N/A logging N/A os N/A tempfile N/A time N/A APPINFO 35 N/A APPWARNING 36 GetLogFileName N/A N/A N/A N/A N/A Helper to produce the log file name. N/A N/A N/A N/A os path join N/A N/A tempfile gettempdir cse_api_tool.log N/A SetupLogging N/A N/A verbose_flag N/A N/A N/A Initialize logging and handle --verbose option.

  Since apiclient discovery uses INFO level (20) for noisy logging of
  URLS, we define a level 35 APPINFO level for normal app info logging.

  Args:
    verbose_flag: command line verbose flag.

  Returns:
    Initialized logger.
   N/A N/A N/A logging addLevelName APPINFO APPINFO N/A N/A N/A logging addLevelName APPWARNING APPWARNING N/A verbose_flag N/A N/A logging_level N/A logging DEBUG N/A Showing VERBOSE output. N/A N/A logging_level APPINFO N/A N/A N/A logging basicConfig level logging_level format %(asctime)s %(levelname)-8s %(message)s datefmt %Y%m%d %H:%M:%S filename N/A GetLogFileName filemode a N/A console_handler N/A N/A logging StreamHandler N/A N/A N/A console_handler setLevel logging_level N/A console_formatter N/A N/A logging Formatter %(levelname)-8s %(message)s N/A N/A N/A console_handler setFormatter console_formatter N/A logger N/A N/A logging getLogger N/A N/A N/A logger addHandler console_handler N/A LogDebug N/A N/A msg N/A N/A N/A Utility function to log debug messages to users.

  Should be used for detailed output that is only useful when working to
  understand unexpected behaviors.

  Args:
    msg: String with the message to print/log.
   N/A N/A N/A N/A N/A logging getLogger debug msg N/A LogInfo N/A N/A msg N/A N/A N/A Utility function to log normal messages to users.

  Should be used for normal output that will be shown and logged to file.

  Args:
    msg: String with the message to print/log.
   N/A N/A N/A N/A N/A logging getLogger log APPINFO msg N/A LogWarning N/A N/A msg N/A N/A N/A Utility function to log warning messages to users.

  Should be used for warning output that will be shown and logged to file.

  Args:
    msg: String with the message to print/log.
   N/A N/A N/A N/A N/A logging getLogger log APPWARNING msg N/A LogError N/A N/A msg error_exception N/A None N/A N/A Utility function to log errors to screen and log file.

  Helps ensure common message-formatting.

  Args:
    msg: String with the message to print/log.
    error_exception: If used in an except, pass e to show exception string in
                     a consistent format.
   N/A error_exception N/A N/A N/A N/A N/A N/A logging getLogger error %s
	(%s) msg error_exception N/A N/A N/A N/A N/A N/A logging getLogger error msg N/A Timer N/A object N/A N/A Simple timer class for timing commands.

  Conveniently used as a context manager:

    from utils.log_utils import Timer

    with Timer() as t:
      // do some timable operation
      MyDbWork()
    print 'Elapsed db work: %s.' % t.secs
   __init__ N/A N/A self log_tag hide_timing N/A None False N/A N/A Allow a tag to auto label the elapsed messages.

    Args:
      log_tag: If supplied, an elapsed message will be logged.
      hide_timing: Allow users to disable messages dynamically.
     N/A N/A self _log_tag log_tag N/A N/A self _hide_timing hide_timing N/A __enter__ N/A N/A self N/A N/A N/A N/A self _start N/A N/A time time N/A self N/A __exit__ N/A N/A self N/A args N/A N/A N/A self _end N/A N/A time time N/A N/A self secs N/A N/A self _end N/A self _start N/A N/A N/A N/A self _hide_timing N/A self _log_tag N/A N/A N/A LogInfo N/A [timing]Elapsed time for %s: %f s N/A N/A self _log_tag N/A self secs N/A N/A