Singleton base class
This line isn't needed in Python 3:

# -*- coding: utf-8 -*-


so you should probably just remove it. UTF-8 is assumed.

Your docstring is indented - why? It's not technically wrong, but it seem like a really arbitrary choice.

I'm not sure how to say this, but none of your sentences are capitalized. If this were a professional code-base, I would absolutely require good grammar and care of documentation. It is, after all, the primary text that represents the code.

I see _thread - you should be using the main threading interface. In particular, use threading.Lock instead of _thread.allocate_lock.

Since you're using Python 3, don't inherit from object - it's a no-op.

You have Logger.get_instance() return an instance of a different class. By this point, one should probably just make a get_logger function instead. Since that's not ideal, perhaps just overload __new__. You can do this with a metaclass, but a decorator is much simpler:

import threading
from functools import wraps

def singleton_new(make_instance):
    lock = threading.Lock()
    instance = None

    @wraps(make_instance)
    def __new__(cls):
        nonlocal instance

        if instance is None:
            with lock:
                if instance is None:
                    instance = make_instance(cls)

        return instance

    return __new__


This is as simple to use as

class Logger:
    @singleton_new
    def __new__(cls):
        return super().__new__(cls)

    def log(self, text):
        print(text)


and doesn't even affect the class' attributes, due to the magic of closures. One could use a class decorator instead, but I think this looks nicest. Note that this also allows usage on classmethods like

@classmethod
@singleton_new
def get_instance(cls):
    return super().__new__(cls)


Past that, I advise you to stick to PEP 8 where you can, which primarily means minor changes for your code.



On a design level, I strongly suggest rethinking using singletons at all. Globals are almost always better in such cases, and for the case of logging singletons aren't apropriate anyway (look instead at neat things like Logbook).

Even if you do conclude, for some reason, that you want singletons, at least consider the Borg pattern instead, which is mildly less aggrivating.