Server IP : 68.65.122.142 / Your IP : 3.145.116.170 Web Server : LiteSpeed System : Linux server167.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64 User : glenirhm ( 1318) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /var/../lib64/python3.8/pydoc_data/../html/../../../opt/alt/ruby32/share/ruby/logger/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
# frozen_string_literal: true class Logger # Default formatter for log messages. class Formatter Format = "%.1s, [%s #%d] %5s -- %s: %s\n" DatetimeFormat = "%Y-%m-%dT%H:%M:%S.%6N" attr_accessor :datetime_format def initialize @datetime_format = nil end def call(severity, time, progname, msg) sprintf(Format, severity, format_datetime(time), Process.pid, severity, progname, msg2str(msg)) end private def format_datetime(time) time.strftime(@datetime_format || DatetimeFormat) end def msg2str(msg) case msg when ::String msg when ::Exception "#{ msg.message } (#{ msg.class })\n#{ msg.backtrace.join("\n") if msg.backtrace }" else msg.inspect end end end end