rotate: close-bedingung fixed
This commit is contained in:
parent
0f6eee9e91
commit
59957f03b7
|
@ -9,11 +9,7 @@ class Semlogger::Rotate
|
||||||
|
|
||||||
def open_if
|
def open_if
|
||||||
name = Time.now.strftime( @filename).gsub /%\$/, $$.to_s
|
name = Time.now.strftime( @filename).gsub /%\$/, $$.to_s
|
||||||
#p at: Time.now, open_if: name, cur: @file ? @file.path : nil, e: @file ? name == @file.path : nil
|
@file.close if @file and name != @file.path
|
||||||
if @file and name == @file.path
|
|
||||||
@file.close
|
|
||||||
@file = nil
|
|
||||||
end
|
|
||||||
@file = File.open name, 'a' unless @file
|
@file = File.open name, 'a' unless @file
|
||||||
@file
|
@file
|
||||||
end
|
end
|
||||||
|
@ -24,5 +20,6 @@ class Semlogger::Rotate
|
||||||
|
|
||||||
def close
|
def close
|
||||||
@file.close
|
@file.close
|
||||||
|
@file = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue