# Path: ubuntucleaner/settings/constants.py
# CONFIG_ROOT = os.path.join(GLib.get_user_config_dir(), 'ubuntu-cleaner')
# 
# Path: ubuntucleaner/utils/system.py
# def get_distro():
# def get_codename():
# def get_desktop():
# def get_app():
# DISTRO = get_distro()
# CODENAME = get_codename()
# DESKTOP = get_desktop()
# APP = get_app()


import logging
import os
import traceback
import gi
from io import StringIO
from gi.repository import Gdk, Gtk, Notify
from ubuntucleaner.settings.constants import CONFIG_ROOT
from ubuntucleaner.utils import system
    from ubuntucleaner.gui import GuiBuilder

class ColoredFormatter(logging.Formatter):
    def __init__(self, msg, use_color=True):
        logging.Formatter.__init__(self, msg)
        self.use_color = use_color

    def format(self, record):
        if self.use_color:
            record.levelname = COLORS.get(record.levelname, record.levelname)
        return logging.Formatter.format(self, record)


class CleanerLogger(logging.Logger):
    COLOR_FORMAT = "[" + BOLD_SEQ + "%(name)s" + RESET_SEQ + \
                   "][%(levelname)s] %(message)s (" + BOLD_SEQ + \
                   "%(filename)s" + RESET_SEQ + ":%(lineno)d)"
    NO_COLOR_FORMAT = "[%(name)s][%(levelname)s] %(message)s " \
                      "(%(filename)s:%(lineno)d)"
    LOG_FILE_HANDLER = None

    def __init__(self, name):
        logging.Logger.__init__(self, name)

        #Add two handlers, a stderr one, and a file one
        color_formatter = ColoredFormatter(CleanerLogger.COLOR_FORMAT)
        no_color_formatter = ColoredFormatter(CleanerLogger.NO_COLOR_FORMAT,
                                              False)

        #create the single file appending handler
        if CleanerLogger.LOG_FILE_HANDLER is None:

# Path: ubuntucleaner/settings/constants.py
# CONFIG_ROOT = os.path.join(GLib.get_user_config_dir(), 'ubuntu-cleaner')
# 
# Path: ubuntucleaner/utils/system.py
# def get_distro():
# def get_codename():
# def get_desktop():
# def get_app():
# DISTRO = get_distro()
# CODENAME = get_codename()
# DESKTOP = get_desktop()
# APP = get_app()


# Path: ubuntucleaner/settings/debug.py
import logging
import os
import traceback
import gi
from io import StringIO
from gi.repository import Gdk, Gtk, Notify
from ubuntucleaner.settings.constants import CONFIG_ROOT
from ubuntucleaner.utils import system
    from ubuntucleaner.gui import GuiBuilder


class ColoredFormatter(logging.Formatter):
    def __init__(self, msg, use_color=True):
        logging.Formatter.__init__(self, msg)
        self.use_color = use_color

    def format(self, record):
        if self.use_color:
            record.levelname = COLORS.get(record.levelname, record.levelname)
        return logging.Formatter.format(self, record)


class CleanerLogger(logging.Logger):
    COLOR_FORMAT = "[" + BOLD_SEQ + "%(name)s" + RESET_SEQ + \
                   "][%(levelname)s] %(message)s (" + BOLD_SEQ + \
                   "%(filename)s" + RESET_SEQ + ":%(lineno)d)"
    NO_COLOR_FORMAT = "[%(name)s][%(levelname)s] %(message)s " \
                      "(%(filename)s:%(lineno)d)"
    LOG_FILE_HANDLER = None

    def __init__(self, name):
        logging.Logger.__init__(self, name)

        #Add two handlers, a stderr one, and a file one
        color_formatter = ColoredFormatter(CleanerLogger.COLOR_FORMAT)
        no_color_formatter = ColoredFormatter(CleanerLogger.NO_COLOR_FORMAT,
                                              False)

        #create the single file appending handler
        if CleanerLogger.LOG_FILE_HANDLER is None:

            filename = os.path.join(CONFIG_ROOT, 'ubuntu-cleaner.log')