clearml_agent/commands/worker.py
def send_logs(self, task_id, lines, level="DEBUG", session=None):
        """
        Send output lines as log events to backend
        :param task_id: ID of task to send logs for
        :type task_id: Text
        :param lines: lines to send
        :type lines: [Text]
        :param str level: log level, default DEBUG
        :return: number of lines sent
        :rtype: int
        """
        if not lines:
            return 0
        print_text("".join(lines), newline=False)

        # remove backspaces from the text log, they look bad.
        for i, l in enumerate(lines):
            lines[i] = l.replace('\x08', '')

        events_service = self.get_service(Events)
        try:
            events_service.send_log_events(
                self.worker_id, task_id=task_id, lines=lines, level=level, session=session
            )
            return len(lines)
        except Exception as e:
            print("\n### Error sending log: %s ###\n" % e)
            # revert number of sent lines (we will try next time)
            return 0

        Send output lines as log events to backend
        :param task_id: ID of task to send logs for
        :type task_id: Text
        :param lines: lines to send
        :type lines: [Text]
        :param str level: log level, default DEBUG
        :return: number of lines sent
        :rtype: int
        
Send output lines as log events to backend
Send output lines as log events to backend
def send_logs(self, task_id, lines, level="DEBUG", session=None):
        if not lines:
            return 0
        print_text("".join(lines), newline=False)
        for i, l in enumerate(lines):
            lines[i] = l.replace('\x08', '')
        events_service = self.get_service(Events)
        try:
            events_service.send_log_events(
                self.worker_id, task_id=task_id, lines=lines, level=level, session=session
            )
            return len(lines)
        except Exception as e:
            print("\n### Error sending log: %s ###\n" % e)
            return 0
def send_logs ( self , task_id , lines , level = "DEBUG" , session = None ) : if not lines : return 0 print_text ( "" . join ( lines ) , newline = False ) for i , l in enumerate ( lines ) : lines [ i ] = l . replace ( '\x08' , '' ) events_service = self . get_service ( Events ) try : events_service . send_log_events ( self . worker_id , task_id = task_id , lines = lines , level = level , session = session ) return len ( lines ) except Exception as e : print ( "\n### Error sending log: %s ###\n" % e ) return 0
Send output lines as log events to backend
Send output lines as log events to backend
"""
        Send output lines as log events to backend
        :param task_id: ID of task to send logs for
        :type task_id: Text
        :param lines: lines to send
        :type lines: [Text]
        :param str level: log level, default DEBUG
        :return: number of lines sent
        :rtype: int
        """ # remove backspaces from the text log, they look bad. # revert number of sent lines (we will try next time)
number of lines sent
number of lines sent
int
self
task_id
ID of task to send logs for
ID of task to send logs for
lines
lines to send
lines to send
level
log level, default DEBUG
log level default DEBUG
session