Class: ActionMCP::Logging::NullLogger
- Inherits:
-
Object
- Object
- ActionMCP::Logging::NullLogger
show all
- Defined in:
- lib/action_mcp/logging/null_logger.rb
Overview
Null logger that performs no operations when logging is disabled Provides the same interface as Logger but with zero overhead
Instance Method Summary
collapse
-
#alert(*args, **kwargs, &block) ⇒ Object
-
#alert? ⇒ Boolean
-
#critical(*args, **kwargs, &block) ⇒ Object
-
#critical? ⇒ Boolean
-
#debug(*args, **kwargs, &block) ⇒ Object
Log methods - all no-ops that return nil immediately.
-
#debug? ⇒ Boolean
Level check methods - all return false (nothing will be logged).
-
#emergency(*args, **kwargs, &block) ⇒ Object
-
#emergency? ⇒ Boolean
-
#error(*args, **kwargs, &block) ⇒ Object
-
#error? ⇒ Boolean
-
#info(*args, **kwargs, &block) ⇒ Object
-
#info? ⇒ Boolean
-
#initialize(*args, **kwargs) ⇒ NullLogger
constructor
Initialize a null logger (no-op).
-
#method_missing(method_name, *args, **kwargs, &block) ⇒ Object
Implement any other methods that might be called to avoid NoMethodError.
-
#notice(*args, **kwargs, &block) ⇒ Object
-
#notice? ⇒ Boolean
-
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
-
#warning(*args, **kwargs, &block) ⇒ Object
(also: #warn)
-
#warning? ⇒ Boolean
(also: #warn?)
Constructor Details
#initialize(*args, **kwargs) ⇒ NullLogger
Initialize a null logger (no-op)
10
11
12
|
# File 'lib/action_mcp/logging/null_logger.rb', line 10
def initialize(*args, **kwargs)
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, **kwargs, &block) ⇒ Object
Implement any other methods that might be called to avoid NoMethodError
83
84
85
86
|
# File 'lib/action_mcp/logging/null_logger.rb', line 83
def method_missing(method_name, *args, **kwargs, &block)
nil
end
|
Instance Method Details
#alert(*args, **kwargs, &block) ⇒ Object
40
41
42
|
# File 'lib/action_mcp/logging/null_logger.rb', line 40
def alert(*args, **kwargs, &block)
nil
end
|
#alert? ⇒ Boolean
74
75
76
|
# File 'lib/action_mcp/logging/null_logger.rb', line 74
def alert?
false
end
|
#critical(*args, **kwargs, &block) ⇒ Object
36
37
38
|
# File 'lib/action_mcp/logging/null_logger.rb', line 36
def critical(*args, **kwargs, &block)
nil
end
|
#critical? ⇒ Boolean
70
71
72
|
# File 'lib/action_mcp/logging/null_logger.rb', line 70
def critical?
false
end
|
#debug(*args, **kwargs, &block) ⇒ Object
Log methods - all no-ops that return nil immediately
15
16
17
|
# File 'lib/action_mcp/logging/null_logger.rb', line 15
def debug(*args, **kwargs, &block)
nil
end
|
#debug? ⇒ Boolean
Level check methods - all return false (nothing will be logged)
49
50
51
|
# File 'lib/action_mcp/logging/null_logger.rb', line 49
def debug?
false
end
|
#emergency(*args, **kwargs, &block) ⇒ Object
44
45
46
|
# File 'lib/action_mcp/logging/null_logger.rb', line 44
def emergency(*args, **kwargs, &block)
nil
end
|
#emergency? ⇒ Boolean
78
79
80
|
# File 'lib/action_mcp/logging/null_logger.rb', line 78
def emergency?
false
end
|
#error(*args, **kwargs, &block) ⇒ Object
32
33
34
|
# File 'lib/action_mcp/logging/null_logger.rb', line 32
def error(*args, **kwargs, &block)
nil
end
|
#error? ⇒ Boolean
66
67
68
|
# File 'lib/action_mcp/logging/null_logger.rb', line 66
def error?
false
end
|
#info(*args, **kwargs, &block) ⇒ Object
19
20
21
|
# File 'lib/action_mcp/logging/null_logger.rb', line 19
def info(*args, **kwargs, &block)
nil
end
|
#info? ⇒ Boolean
53
54
55
|
# File 'lib/action_mcp/logging/null_logger.rb', line 53
def info?
false
end
|
#notice(*args, **kwargs, &block) ⇒ Object
23
24
25
|
# File 'lib/action_mcp/logging/null_logger.rb', line 23
def notice(*args, **kwargs, &block)
nil
end
|
#notice? ⇒ Boolean
57
58
59
|
# File 'lib/action_mcp/logging/null_logger.rb', line 57
def notice?
false
end
|
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
88
89
90
91
|
# File 'lib/action_mcp/logging/null_logger.rb', line 88
def respond_to_missing?(method_name, include_private = false)
true
end
|
#warning(*args, **kwargs, &block) ⇒ Object
Also known as:
warn
27
28
29
|
# File 'lib/action_mcp/logging/null_logger.rb', line 27
def warning(*args, **kwargs, &block)
nil
end
|
#warning? ⇒ Boolean
Also known as:
warn?
61
62
63
|
# File 'lib/action_mcp/logging/null_logger.rb', line 61
def warning?
false
end
|