16 from contextlib
import contextmanager
17 from os.path
import exists, dirname
21 html_format, is_string, is_unicode, timestamp_to_secs,
24 from .stringcache
import StringCache
29 def __init__(self, log_path=None, split_log=False, prune_input=False):
40 def string(self, string, escape=True, attr=False):
44 string = (html_escape
if not attr
else attribute_escape)(string)
45 return self.
_strings_strings.add(string)
52 if self.
_log_dir_log_dir
and source
and exists(source)
else ''
53 return self.
stringstring(rel_source)
64 if LEVELS[level] < LEVELS[self.
min_levelmin_level]:
75 return (msg.message, msg.level, msg.timestamp)
def message_level(self, level)
def string(self, string, escape=True, attr=False)
def start_splitting_if_needed(self, split=False)
def prune_input(self, *items)
def end_splitting(self, model)
def create_link_target(self, msg)
def relative_source(self, source)
def __init__(self, log_path=None, split_log=False, prune_input=False)
def timestamp(self, time)
def get_link_path(target, base)
Returns a relative path to target from base.
def timestamp_to_secs(timestamp, seps=None)