Skip to content

Commit d336fd3

Browse files
fix lint
1 parent 01d507e commit d336fd3

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

lib/skywalking/agent.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,16 @@ def start_log_reporting_thread
130130
# Process the log queue and send data to the server
131131
def process_log_queue
132132
log_count = 0
133-
Enumerator.new do |yielder|
133+
enumerator = Enumerator.new do |yielder|
134134
while (log_data = log_buffer.stream_data)
135135
log_data.each do |data|
136136
log_count += 1
137137
yielder << data
138138
end
139139
end
140-
end.each_slice(10) do |batch|
140+
end
141+
142+
enumerator.each_slice(10) do |batch|
141143
begin
142144
reporter.report_log(batch)
143145
rescue => e

lib/skywalking/meter.rb

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,7 @@
2323
module Skywalking
2424
# Main module for meter functionality
2525
module Meter
26-
# Export key classes for external use
27-
DataSource = DataSource
28-
Gauge = Gauge
29-
MeterService = MeterService
30-
31-
module Runtime
32-
CpuDataSource = CpuDataSource
33-
MemDataSource = MemDataSource
34-
GcDataSource = GcDataSource
35-
ThreadDataSource = ThreadDataSource
36-
end
26+
# Classes are already defined through require statements above
27+
# No need to reassign them to themselves
3728
end
3829
end

lib/skywalking/plugins/logger.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def add(severity, message = nil, progname = nil, &block)
7474
begin
7575
collect_log_data(severity, message, progname, &block)
7676
rescue => e
77-
$stderr.puts "SkyWalking log collection error: #{e.message}" if $DEBUG
77+
warn "SkyWalking log collection error: #{e.message}" if $DEBUG
7878
ensure
7979
# Always clear the flag
8080
Thread.current[COLLECTING_LOG_KEY] = false

0 commit comments

Comments
 (0)