)]}'
{"Engine/agent/storlet_daemon_factory/daemon_factory.py":[{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"482a1050807a67dee573aab8c5371d7d2b497907","unresolved":false,"context_lines":[{"line_number":229,"context_line":"            stderr_logfile \u003d LoggerFileObject(self.logger, \u0027STDERR\u0027,"},{"line_number":230,"context_line":"                                              storlet_name)"},{"line_number":231,"context_line":"            sdaemon_p \u003d subprocess.Popen("},{"line_number":232,"context_line":"                pargs, stdout\u003dstdout_logfile, stderr\u003dstderr_logfile,"},{"line_number":233,"context_line":"                close_fds\u003dTrue, shell\u003dFalse, env\u003denv)"},{"line_number":234,"context_line":"            sdaemon_pid \u003d sdaemon_p.pid"},{"line_number":235,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a98d1f4_c1cd96b8","line":232,"range":{"start_line":232,"start_character":23,"end_line":232,"end_character":66},"updated":"2016-09-30 14:35:21.000000000","message":"I noticed that we can not do this, because Popen requires the file object has fd (has fileno() implementation)\nI\u0027ll think about it later.","commit_id":"1b854fb130c216af9a740bdb9fd8e945184bd6d6"},{"author":{"_account_id":11317,"name":"Eran Rom","email":"eran@itsonlyme.name","username":"eranr"},"change_message_id":"3a4a154b4a1c8a945d903248ce5807f729ff7646","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    return func"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"class LoggerFileObject(object):"},{"line_number":83,"context_line":"    def __init__(self, logger, log_type\u003d\u0027STDOUT\u0027):"},{"line_number":84,"context_line":"        self.logger \u003d logger"},{"line_number":85,"context_line":"        self.log_type \u003d log_type"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a95cdbc_d8f1c796","line":82,"updated":"2016-10-09 19:56:19.000000000","message":"I am curious whether this is a standard way to \"override\" sys.stderr / sys.stdout. I guess that an alternative approach would be to:\n1. open /dev/log to get a \u0027log_fd\u0027 (before we impersonate)\n2. override the factory sys.stderr, sys.stdout with log_fd\n3. pass log_fd as stdout, stderr in Popen (line 223).\n\nIf this approach is valid, it helps us:\n1. Have a solution for the Java sdaemon which today cannot log to the host syslog as Java cannot hook to syslog via a fd.\n2. Get rid of the logger process created in line 226\n3. No need to override stderr, stdout both here and in the Python sdaemon","commit_id":"dfb6d78981faaa3fe9d647e8a422b1a3f647076a"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"8b5a537d7b0a91bd8ba75594bbaba2aa8f51cbd2","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    return func"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"class LoggerFileObject(object):"},{"line_number":83,"context_line":"    def __init__(self, logger, log_type\u003d\u0027STDOUT\u0027):"},{"line_number":84,"context_line":"        self.logger \u003d logger"},{"line_number":85,"context_line":"        self.log_type \u003d log_type"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba5da102_e808cd2f","line":82,"in_reply_to":"1a95cdbc_d8f1c796","updated":"2016-11-01 05:11:42.000000000","message":"\u003e I am curious whether this is a standard way to \"override\" sys.stderr / sys.stdout.\n\nThis implementation is ported from swift. I don\u0027t know it is really standard, but I think it is very simple but valid solution in python, with keeping logger configuration.\n\n\u003e I guess that an alternative approach would be to:\n\nI know this can be more standard, and can be used for Java, but the problem here is that it is not so easy to handle logger setting. (I mean, to use the same logger setting for stdout/stderr logging as the base process)","commit_id":"dfb6d78981faaa3fe9d647e8a422b1a3f647076a"}]}
