Skip to content
Snippets Groups Projects
Commit 9c33b344 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

log retrieval interfaces were undefined

parent 7d506daa
No related branches found
No related tags found
No related merge requests found
from satella.instrumentation.logging.logentry import LogEntry from satella.instrumentation.logging.logentry import LogEntry
from satella.instrumentation.logging.logentrysetinterface import LogEntrySetInterface
from satella.instrumentation.logging.loggerinterface import LoggerInterface from satella.instrumentation.logging.loggerinterface import LoggerInterface
class LogEntrySetInterface(object):
"""
A sequence of .when-ordered log events along with methods to process the stream.
Implementing this interface allows an application to retrieve events in a backend-agnostic
manner.
"""
def events(self):
"""
Return an iterator that will return events sorted ascending
order by .when, and that will return L{LogEntry} objects (or
descendants)
"""
raise RuntimeError, 'abstract'
def filter(self, **kwargs):
"""
Filters the result set according to kwargs keys and values.
Because of how backends may differ, this is expected to minimally implement
following keys (for kwargs):
- when__lt - .when less than value
- when__le - .when less or equal than value
- when__gt - .when greater than value
- when__ge - .when greater or equal than value
- who_hierarchy - either .who is equal to value, or if you take away the value
from .who, then the first character will be a dot
- who - .who equal to value
- tags__in - intersection of .tags and value is nonempty
- tags - .tags equal to value
Returns a L{LogSetInterface} implementation that will not include filtered out values
shall it's .events() be called.
If an implementation-specified order of .filter() calls or simultaneous kwargs entries
is not supported, .filter is to raise ValueError.
"""
raise RuntimeError, 'abstract'
from satella.instrumentation.logging import LogEntry, LogEntrySetInterface, LoggerInterface from satella.instrumentation.logging import LogEntry, LoggerInterface
# LoggerInterface and LogEntrySetInterface is implemented only as API check # LoggerInterface is implemented only as API check
import unittest import unittest
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment