!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/lib/python3/dist-packages/aptdaemon/   drwxr-xr-x
Free 12.97 GB of 57.97 GB (22.38%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     logger.py (2.3 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Logging facilities for aptdaemon
"""
# Copyright (C) 2013 Sebastian Heinlein <devel@glatzor.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

__author__ = "Sebastian Heinlein <devel@glatzor.de>"

__all__ = ("ColoredFormatter")

import logging
import os

# Define some foreground colors
BLACK = 30
RED = 31
GREEN = 32
YELLOW = 33
BLUE = 34
MAGENTA = 35
CYAN = 36
WHITE = 37

# Terminal control sequences to format output
RESET_SEQ = "\033[0m"
COLOR_SEQ = "\033[1;%dm"
BOLD_SEQ = "\033[1m"

COLORS = {
    logging.WARN: YELLOW,
    logging.INFO: BLUE,
    logging.DEBUG: CYAN,
    logging.CRITICAL: RED,
    logging.ERROR: RED
}


class ColoredFormatter(logging.Formatter):

    """Adds some color to the log messages.

    http://stackoverflow.com/questions/384076/\
            how-can-i-color-python-logging-output
    """

    def __init__(self, fmt=None, datefmt=None, use_color=True):
        logging.Formatter.__init__(self, fmt, datefmt)
        if os.getenv("TERM") in ["xterm", "xterm-colored", "linux"]:
            self.use_color = use_color
        else:
            self.use_color = False

    def format(self, record):
        """Return the formated output string."""
        if self.use_color and record.levelno in COLORS:
            record.levelname = (COLOR_SEQ % COLORS[record.levelno] +
                                record.levelname +
                                RESET_SEQ)
            record.name = COLOR_SEQ % GREEN + record.name + RESET_SEQ
            if record.levelno in [logging.CRITICAL, logging.ERROR]:
                record.msg = COLOR_SEQ % RED + record.msg + RESET_SEQ
        return logging.Formatter.format(self, record)

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0307 ]--