Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions gems/logger/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This configuration inherits from /.rubocop.yml.
# You can configure RBS style of this gem.
# This file is used on CI. It is configured to automatically
# make rubocop suggestions on pull requests for this gem.
# If you do not like the style enforcement, you should remove this file.
inherit_from: ../../.rubocop.yml

##
# If you want to customize the style, please consult with the gem reviewers.
# You can see the list of cops at https://github.com/ksss/rubocop-on-rbs/blob/main/docs/modules/ROOT/pages/cops.adoc

RBS/Layout:
Enabled: true

RBS/Lint:
Enabled: true

RBS/Style:
Enabled: true
45 changes: 45 additions & 0 deletions gems/logger/1.7/formatter.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
%a{annotate:rdoc:skip}
class Logger
# <!-- rdoc-file=lib/logger/formatter.rb -->
# Default formatter for log messages.
#
class Formatter
attr_accessor datetime_format: String?

# <!--
# rdoc-file=lib/logger/formatter.rb
# - call(severity, time, progname, msg)
# -->
#
def call: (String severity, Time time, untyped progname, untyped msg) -> String

private

# <!--
# rdoc-file=lib/logger/formatter.rb
# - format_datetime(time)
# -->
#
def format_datetime: (Time time) -> untyped

# <!--
# rdoc-file=lib/logger/formatter.rb
# - new()
# -->
#
def initialize: () -> void

# <!--
# rdoc-file=lib/logger/formatter.rb
# - msg2str(msg)
# -->
#
def msg2str: (String | Exception | untyped msg) -> String
end

interface _Formatter
def call: (String severity, Time time, untyped progname, untyped msg) -> _ToS
end
end

Logger::Formatter::Format: String
100 changes: 100 additions & 0 deletions gems/logger/1.7/log_device.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
%a{annotate:rdoc:skip}
class Logger
# <!-- rdoc-file=lib/logger/log_device.rb -->
# Device used for logging messages.
#
class LogDevice
include MonitorMixin

include Period

attr_reader dev: _WriteCloser
attr_reader filename: String?

# <!--
# rdoc-file=lib/logger/log_device.rb
# - close()
# -->
#
def close: () -> nil

# <!--
# rdoc-file=lib/logger/log_device.rb
# - reopen(log = nil)
# -->
#
def reopen: (?logdev log) -> self

# <!--
# rdoc-file=lib/logger/log_device.rb
# - write(message)
# -->
#
def write: (untyped message) -> untyped

private

# <!--
# rdoc-file=lib/logger/log_device.rb
# - add_log_header(file)
# -->
#
def add_log_header: (IO file) -> untyped

# <!--
# rdoc-file=lib/logger/log_device.rb
# - check_shift_log()
# -->
#
def check_shift_log: () -> untyped

# <!--
# rdoc-file=lib/logger/log_device.rb
# - create_logfile(filename)
# -->
#
def create_logfile: (String filename) -> File

# <!--
# rdoc-file=lib/logger/log_device.rb
# - new(log = nil, shift_age: nil, shift_size: nil, shift_period_suffix: nil, binmode: false, reraise_write_errors: [])
# -->
#
def initialize: (?untyped logdev, ?binmode: boolish, ?shift_period_suffix: String, ?shift_size: Integer, ?shift_age: Numeric | String) -> void

# <!--
# rdoc-file=lib/logger/log_device.rb
# - lock_shift_log() { || ... }
# -->
#
def lock_shift_log: () { () -> untyped } -> untyped

# <!--
# rdoc-file=lib/logger/log_device.rb
# - open_logfile(filename)
# -->
#
def open_logfile: (String filename) -> File

# <!--
# rdoc-file=lib/logger/log_device.rb
# - set_dev(log)
# -->
#
def set_dev: (logdev log) -> untyped

# <!--
# rdoc-file=lib/logger/log_device.rb
# - shift_log_age()
# -->
#
def shift_log_age: () -> true

# <!--
# rdoc-file=lib/logger/log_device.rb
# - shift_log_period(period_end)
# -->
#
def shift_log_period: (Time period_end) -> true
end
end
Loading
Loading