Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def as_mode(self, mode):
"""
create a new LogWriter with mode and return it.
:param mode: The logger will group data under mode.
:type mode: basestring
:return: the logWriter itself
:rtype: LogWriter
"""
check_mode_name_valid(mode)
LogWriter.cur_mode = LogWriter(self.dir, self.sync_cycle,
self.writer.as_mode(mode))
return LogWriter.cur_mode
def as_mode(self, mode):
"""
create a new LogWriter with mode and return it.
:param mode: The logger will group data under mode.
:type mode: basestring
:return: the logWriter itself
:rtype: LogWriter
"""
check_mode_name_valid(mode)
LogWriter.cur_mode = LogWriter(self.dir, self.sync_cycle,
self.writer.as_mode(mode))
return LogWriter.cur_mode