# Path: tornado/log.py
# def define_logging_options(options=None):
#     if options is None:
#         # late import to prevent cycle
#         from tornado.options import options
#     options.define("logging", default="info",
#            help=("Set the Python log level. If 'none', tornado won't touch the "
#                  "logging configuration."),
#            metavar="debug|info|warning|error|none")
#     options.define("log_to_stderr", type=bool, default=None,
#            help=("Send log output to stderr (colorized if possible). "
#                  "By default use stderr if --log_file_prefix is not set and "
#                  "no other logging is configured."))
#     options.define("log_file_prefix", type=str, default=None, metavar="PATH",
#            help=("Path prefix for log files. "
#                  "Note that if you are running multiple tornado processes, "
#                  "log_file_prefix must be different for each of them (e.g. "
#                  "include the port number)"))
#     options.define("log_file_max_size", type=int, default=100 * 1000 * 1000,
#            help="max size of log files before rollover")
#     options.define("log_file_num_backups", type=int, default=10,
#            help="number of log files to keep")
# 
#     options.add_parse_callback(enable_pretty_logging)
# 
# Path: tornado/stack_context.py
# class _State(threading.local):
# class StackContext(object):
# class ExceptionStackContext(object):
# class NullContext(object):
# class _StackContextWrapper(functools.partial):
#     def __init__(self):
#     def __init__(self, context_factory, _active_cell=None):
#     def __enter__(self):
#     def __exit__(self, type, value, traceback):
#     def __init__(self, exception_handler, _active_cell=None):
#     def __enter__(self):
#     def __exit__(self, type, value, traceback):
#     def __enter__(self):
#     def __exit__(self, type, value, traceback):
# def wrap(fn):
#     def wrapped(*args, **kwargs):
# def _nested(*managers):


import datetime
import re
import sys
import os
import textwrap
from tornado.escape import _unicode
from tornado.log import define_logging_options
from tornado import stack_context

    See `OptionParser.parse_command_line`.
    """
    return options.parse_command_line(args, final=final)


def parse_config_file(path, final=True):
    """Parses global options from a config file.

    See `OptionParser.parse_config_file`.
    """
    return options.parse_config_file(path, final=final)


def print_help(file=None):
    """Prints all the command line options to stderr (or another file).

    See `OptionParser.print_help`.
    """
    return options.print_help(file)

def add_parse_callback(callback):
    """Adds a parse callback, to be invoked when option parsing is done.

    See `OptionParser.add_parse_callback`
    """
    options.add_parse_callback(callback)


# Default options

# Path: tornado/log.py
# def define_logging_options(options=None):
#     if options is None:
#         # late import to prevent cycle
#         from tornado.options import options
#     options.define("logging", default="info",
#            help=("Set the Python log level. If 'none', tornado won't touch the "
#                  "logging configuration."),
#            metavar="debug|info|warning|error|none")
#     options.define("log_to_stderr", type=bool, default=None,
#            help=("Send log output to stderr (colorized if possible). "
#                  "By default use stderr if --log_file_prefix is not set and "
#                  "no other logging is configured."))
#     options.define("log_file_prefix", type=str, default=None, metavar="PATH",
#            help=("Path prefix for log files. "
#                  "Note that if you are running multiple tornado processes, "
#                  "log_file_prefix must be different for each of them (e.g. "
#                  "include the port number)"))
#     options.define("log_file_max_size", type=int, default=100 * 1000 * 1000,
#            help="max size of log files before rollover")
#     options.define("log_file_num_backups", type=int, default=10,
#            help="number of log files to keep")
# 
#     options.add_parse_callback(enable_pretty_logging)
# 
# Path: tornado/stack_context.py
# class _State(threading.local):
# class StackContext(object):
# class ExceptionStackContext(object):
# class NullContext(object):
# class _StackContextWrapper(functools.partial):
#     def __init__(self):
#     def __init__(self, context_factory, _active_cell=None):
#     def __enter__(self):
#     def __exit__(self, type, value, traceback):
#     def __init__(self, exception_handler, _active_cell=None):
#     def __enter__(self):
#     def __exit__(self, type, value, traceback):
#     def __enter__(self):
#     def __exit__(self, type, value, traceback):
# def wrap(fn):
#     def wrapped(*args, **kwargs):
# def _nested(*managers):


# Path: tornado/options.py
import datetime
import re
import sys
import os
import textwrap
from tornado.escape import _unicode
from tornado.log import define_logging_options
from tornado import stack_context


    See `OptionParser.parse_command_line`.
    """
    return options.parse_command_line(args, final=final)


def parse_config_file(path, final=True):
    """Parses global options from a config file.

    See `OptionParser.parse_config_file`.
    """
    return options.parse_config_file(path, final=final)


def print_help(file=None):
    """Prints all the command line options to stderr (or another file).

    See `OptionParser.print_help`.
    """
    return options.print_help(file)

def add_parse_callback(callback):
    """Adds a parse callback, to be invoked when option parsing is done.

    See `OptionParser.add_parse_callback`
    """
    options.add_parse_callback(callback)


# Default options

define_logging_options(options)