.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.metrics.error_recorder.ErrorContext Class Reference

Public Member Functions

 __init__ (self, str filename, str function, int line_no, str code, str exception_classname, str log_message, LogParametersType log_parameters, bool secondary)
bool __eq__ (self, o)
 __hash__ (self)
 __repr__ (self)

Public Attributes

str filename = filename
str function = function
int line_no = line_no
str code = code
str exception_classname = exception_classname
str log_message = log_message
LogParametersType log_parameters = log_parameters
bool secondary = secondary

Static Private Attributes

tuple __slots__

Detailed Description

Definition at line 25 of file error_recorder.py.

Constructor & Destructor Documentation

◆ __init__()

searx.metrics.error_recorder.ErrorContext.__init__ ( self,
str filename,
str function,
int line_no,
str code,
str exception_classname,
str log_message,
LogParametersType log_parameters,
bool secondary )

Definition at line 38 of file error_recorder.py.

48 ):
49 self.filename: str = filename
50 self.function: str = function
51 self.line_no: int = line_no
52 self.code: str = code
53 self.exception_classname: str = exception_classname
54 self.log_message: str = log_message
55 self.log_parameters: LogParametersType = log_parameters
56 self.secondary: bool = secondary
57

Member Function Documentation

◆ __eq__()

bool searx.metrics.error_recorder.ErrorContext.__eq__ ( self,
o )

Definition at line 58 of file error_recorder.py.

58 def __eq__(self, o) -> bool: # pylint: disable=invalid-name
59 if not isinstance(o, ErrorContext):
60 return False
61 return (
62 self.filename == o.filename
63 and self.function == o.function
64 and self.line_no == o.line_no
65 and self.code == o.code
66 and self.exception_classname == o.exception_classname
67 and self.log_message == o.log_message
68 and self.log_parameters == o.log_parameters
69 and self.secondary == o.secondary
70 )
71

References code, exception_classname, searx.exceptions.SearxSettingsException.filename, filename, function, line_no, log_message, log_parameters, and secondary.

◆ __hash__()

searx.metrics.error_recorder.ErrorContext.__hash__ ( self)

Definition at line 72 of file error_recorder.py.

72 def __hash__(self):
73 return hash(
74 (
75 self.filename,
76 self.function,
77 self.line_no,
78 self.code,
79 self.exception_classname,
80 self.log_message,
81 self.log_parameters,
82 self.secondary,
83 )
84 )
85

References code, exception_classname, searx.exceptions.SearxSettingsException.filename, filename, function, line_no, log_message, log_parameters, and secondary.

◆ __repr__()

searx.metrics.error_recorder.ErrorContext.__repr__ ( self)

Definition at line 86 of file error_recorder.py.

86 def __repr__(self):
87 return "ErrorContext({!r}, {!r}, {!r}, {!r}, {!r}, {!r}) {!r}".format(
88 self.filename,
89 self.line_no,
90 self.code,
91 self.exception_classname,
92 self.log_message,
93 self.log_parameters,
94 self.secondary,
95 )
96
97

References code, exception_classname, searx.exceptions.SearxSettingsException.filename, filename, line_no, log_message, log_parameters, and secondary.

Member Data Documentation

◆ __slots__

tuple searx.metrics.error_recorder.ErrorContext.__slots__
staticprivate
Initial value:
= (
'filename',
'function',
'line_no',
'code',
'exception_classname',
'log_message',
'log_parameters',
'secondary',
)

Definition at line 27 of file error_recorder.py.

◆ code

searx.metrics.error_recorder.ErrorContext.code = code

Definition at line 52 of file error_recorder.py.

Referenced by __eq__(), __hash__(), and __repr__().

◆ exception_classname

searx.metrics.error_recorder.ErrorContext.exception_classname = exception_classname

Definition at line 53 of file error_recorder.py.

Referenced by __eq__(), __hash__(), and __repr__().

◆ filename

searx.metrics.error_recorder.ErrorContext.filename = filename

◆ function

searx.metrics.error_recorder.ErrorContext.function = function

Definition at line 50 of file error_recorder.py.

Referenced by __eq__(), and __hash__().

◆ line_no

searx.metrics.error_recorder.ErrorContext.line_no = line_no

Definition at line 51 of file error_recorder.py.

Referenced by __eq__(), __hash__(), and __repr__().

◆ log_message

searx.metrics.error_recorder.ErrorContext.log_message = log_message

Definition at line 54 of file error_recorder.py.

Referenced by __eq__(), __hash__(), and __repr__().

◆ log_parameters

searx.metrics.error_recorder.ErrorContext.log_parameters = log_parameters

Definition at line 55 of file error_recorder.py.

Referenced by __eq__(), __hash__(), and __repr__().

◆ secondary

searx.metrics.error_recorder.ErrorContext.secondary = secondary

Definition at line 56 of file error_recorder.py.

Referenced by __eq__(), __hash__(), and __repr__().


The documentation for this class was generated from the following file: