#!/usr/bin/python
#-*- coding: utf-8 -*-

from abc import ABCMeta, abstractmethod
import logging


class base1(object):
    __metaclass__ = ABCMeta

    log = None
    test = "test"

    def __init__(self):
        pass
        print "---base.init---"

    @abstractmethod
    def setting(self, log):
        pass

    def runbase(self):
        if self.log is not None:
            self.log.info("base method run....")
            self.log.debug("------------------------------------------" + self.test)




class child(base1):

    def __init__(self):
        base1.__init__(self)
        print "---child.init---"



    def setting(self, log):
        self.log = log

    def run(self):
        if self.log is not None:
            self.log.info("child method run....")
            self.log.debug("------------------------------------------" + self.test)





if __name__ == "__main__":

    logging.basicConfig(level=logging.DEBUG)
    logi = logging.getLogger("ikchoi")
    logi.debug("========================================================")


    ch = child()
    ch.setting(logi)
    print "\n"

    ch.run()


    print "\n\n"

    ch.runbase()