File tree 2 files changed +8
-7
lines changed
2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
6
6
## [ unreleased]
7
7
8
8
- Add support for Ruby 3.3
9
+ - Allow SyncProcessor to be called from appenders
9
10
- Fix incorrect metrics usage examples in documentation
10
11
11
12
## [ 4.15.0]
Original file line number Diff line number Diff line change @@ -2,26 +2,26 @@ module SemanticLogger
2
2
# The SyncProcessor performs logging in the current thread.
3
3
#
4
4
# Appenders are designed to only be used by one thread at a time, so all calls
5
- # are mutex protected in case SyncProcessor is being used in a multi-threaded environment.
5
+ # are monitor protected in case SyncProcessor is being used in a multi-threaded environment.
6
6
class SyncProcessor
7
7
def add ( *args , &block )
8
- @mutex . synchronize { @appenders . add ( *args , &block ) }
8
+ @monitor . synchronize { @appenders . add ( *args , &block ) }
9
9
end
10
10
11
11
def log ( *args , &block )
12
- @mutex . synchronize { @appenders . log ( *args , &block ) }
12
+ @monitor . synchronize { @appenders . log ( *args , &block ) }
13
13
end
14
14
15
15
def flush
16
- @mutex . synchronize { @appenders . flush }
16
+ @monitor . synchronize { @appenders . flush }
17
17
end
18
18
19
19
def close
20
- @mutex . synchronize { @appenders . close }
20
+ @monitor . synchronize { @appenders . close }
21
21
end
22
22
23
23
def reopen ( *args )
24
- @mutex . synchronize { @appenders . reopen ( *args ) }
24
+ @monitor . synchronize { @appenders . reopen ( *args ) }
25
25
end
26
26
27
27
# Allow the internal logger to be overridden from its default of $stderr
@@ -47,7 +47,7 @@ def self.logger
47
47
attr_reader :appenders
48
48
49
49
def initialize ( appenders = nil )
50
- @mutex = Mutex . new
50
+ @monitor = Monitor . new
51
51
@appenders = appenders || Appenders . new ( self . class . logger . dup )
52
52
end
53
53
You can’t perform that action at this time.
0 commit comments