REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.06 KB
Close
/lib/python3.6/site-packages/up2date_client/up2dateLog.py
Text
Base64
# import time import traceback from rhn.i18n import ustr, sstr from up2date_client import config class Log: """ attempt to log all interesting stuff, namely, anything that hits the network any error messages, package installs, etc """ # " emacs sucks def __init__(self): self.app = "up2date" self.cfg = config.initUp2dateConfig() self.log_info = '' def set_app_name(self, name): self.app = str(name) def log_debug(self, *args): if self.cfg["debug"] > 1: self.log_me("D: ", *args) def log_me(self, *args): """General logging function. Eg: log_me("I am a banana.") """ self.log_info = "[%s] %s" % (time.ctime(time.time()), self.app) s = u"" for i in args: # we really need unicode(str(i)) here, because i can be anything # from string or int to list, dict or even class i = ustr(str(i)) s += i if self.cfg["debug"] > 1: print(s) self.write_log(s) def trace_me(self): self.log_info = "[%s] %s" % (time.ctime(time.time()), self.app) x = traceback.extract_stack() msg = ''.join(traceback.format_list(x)) self.write_log(msg) def log_exception(self, logtype, value, tb): self.log_info = "[%s] %s" % (time.ctime(time.time()), self.app) output = ["\n"] # Accumulate the strings in a list output.append("Traceback (most recent call last):\n") output = output + traceback.format_list(traceback.extract_tb(tb)) output.append("%s: %s\n" % (logtype, value)) self.write_log("".join(output)) def write_log(self, s): log_name = self.cfg["logFile"] or "/var/log/up2date" log_file = open(log_name, 'a') msg = u"%s %s\n" % (ustr(self.log_info), ustr(s)) log_file.write(sstr(msg)) log_file.flush() log_file.close() def initLog(): global log try: log = log except NameError: log = None if log == None: log = Log() return log
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 14
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2026-05-29 07:17:07
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
clpwd.py
3.56 KB
lrw-r--r--
2026-04-24 15:42:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
config.py
13.26 KB
lrw-r--r--
2026-04-24 15:42:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
hardware.py
5.09 KB
lrw-r--r--
2026-04-24 15:42:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
pkgplatform.py
309 B
lrw-r--r--
2026-04-27 12:46:07
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
rhncli.py
7.46 KB
lrw-r--r--
2026-04-24 15:42:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
rhnreg.py
10.52 KB
lrw-r--r--
2026-04-24 15:42:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
rhnserver.py
8.54 KB
lrw-r--r--
2026-04-24 15:42:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
rpcServer.py
11.10 KB
lrw-r--r--
2026-04-24 15:42:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
statistics.py
1.27 KB
lrw-r--r--
2026-04-24 15:42:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
up2dateAuth.py
10.49 KB
lrw-r--r--
2026-04-24 15:42:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
up2dateErrors.py
7.99 KB
lrw-r--r--
2026-04-24 15:42:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
up2dateLog.py
2.06 KB
lrw-r--r--
2026-04-24 15:42:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
up2dateUtils.py
1.73 KB
lrw-r--r--
2026-04-27 12:46:07
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
0 B
lrw-r--r--
2026-04-24 15:42:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).