# Path: memsql_loader/util/command.py
# class Command(object):
#     def __init__(self, options):
#         self.options = options
#         self.ensure_bootstrapped()
#         self.run()
# 
#     @staticmethod
#     def configure(parser, subparsers):
#         raise NotImplemented('Every command needs a static configure(...) method')
# 
#     def ensure_bootstrapped(self):
#         if not bootstrap.check_bootstrapped():
#             bootstrap.bootstrap()
# 
#     def run():
#         raise NotImplemented('Every command needs a run method, otherwise not much is going to happen')
# 
# Path: memsql_loader/util/log.py
# def setup(log_path=None, stdout_enabled=True):
# def update_verbosity(debug=False, extra_verbose=False):
#     def __call__(self, parser, namespace, value, option_string=None):
#     def __call__(self, parser, namespace, value, option_string=None):
#     def __call__(self, parser, namespace, value, option_string=None):
# def configure(parser):
# def get_logger(name, level=None):
#     def format(self, record):
#     def __init__(self, name, level=logging.DEBUG):
# class _SetDebug(argparse.Action):
# class _SetStdout(argparse.Action):
# class _SetLogPath(argparse.Action):
# class Formatter(logging.Formatter):
# class Logger(logging.Logger):


import sys
import os
from memsql_loader.util.command import Command
from memsql_loader.util import log


class Log(Command):
    @staticmethod
    def configure(parser, subparsers):
        subparser = subparsers.add_parser('log', help='Tail the MemSQL Loader log file or print out it\'s path.')
        subparser.set_defaults(command=Log)

        subparser.add_argument('-p', '--path', default=False, action='store_true',
            help='Print out the MemSQL Loader logfile path and then exit.')
        subparser.add_argument('-n', '--characters', default=100, type=int,
            help='Output the last n characters rather than the last 100.')

    def run(self):
        if self.options.path:

# Path: memsql_loader/util/command.py
# class Command(object):
#     def __init__(self, options):
#         self.options = options
#         self.ensure_bootstrapped()
#         self.run()
# 
#     @staticmethod
#     def configure(parser, subparsers):
#         raise NotImplemented('Every command needs a static configure(...) method')
# 
#     def ensure_bootstrapped(self):
#         if not bootstrap.check_bootstrapped():
#             bootstrap.bootstrap()
# 
#     def run():
#         raise NotImplemented('Every command needs a run method, otherwise not much is going to happen')
# 
# Path: memsql_loader/util/log.py
# def setup(log_path=None, stdout_enabled=True):
# def update_verbosity(debug=False, extra_verbose=False):
#     def __call__(self, parser, namespace, value, option_string=None):
#     def __call__(self, parser, namespace, value, option_string=None):
#     def __call__(self, parser, namespace, value, option_string=None):
# def configure(parser):
# def get_logger(name, level=None):
#     def format(self, record):
#     def __init__(self, name, level=logging.DEBUG):
# class _SetDebug(argparse.Action):
# class _SetStdout(argparse.Action):
# class _SetLogPath(argparse.Action):
# class Formatter(logging.Formatter):
# class Logger(logging.Logger):


# Path: memsql_loader/cli/log.py
import sys
import os
from memsql_loader.util.command import Command
from memsql_loader.util import log



class Log(Command):
    @staticmethod
    def configure(parser, subparsers):
        subparser = subparsers.add_parser('log', help='Tail the MemSQL Loader log file or print out it\'s path.')
        subparser.set_defaults(command=Log)

        subparser.add_argument('-p', '--path', default=False, action='store_true',
            help='Print out the MemSQL Loader logfile path and then exit.')
        subparser.add_argument('-n', '--characters', default=100, type=int,
            help='Output the last n characters rather than the last 100.')

    def run(self):
        if self.options.path:

            print(log._log_path)