Commit bc70a753 authored by Julien Muchembled's avatar Julien Muchembled

neolog: do not spam the console when piped to a process that exits prematurely

parent 9bd31803
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import bz2, gzip, optparse, os, signal, sqlite3, time import bz2, gzip, errno, optparse, os, signal, sqlite3, sys, time
from bisect import insort from bisect import insort
from logging import getLevelName from logging import getLevelName
...@@ -174,6 +174,10 @@ def emit_many(log_list): ...@@ -174,6 +174,10 @@ def emit_many(log_list):
while event[0] <= next_date: while event[0] <= next_date:
emit(*event) emit(*event)
event = next() event = next()
except IOError, e:
if e.errno == errno.EPIPE:
sys.exit(1)
raise
except StopIteration: except StopIteration:
if not event_list: if not event_list:
break break
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment