lj-clitools/exports/toNull.py

47 lines
809 B
Python
Raw Normal View History

2020-11-11 16:31:08 +00:00
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# -*- mode: Python -*-
'''
The exporter that drops all traffic !
v0.1.0
A basic exporter
LICENCE : CC
by cocoa
'''
from __future__ import print_function
import sys
import os
import argparse
import redis
import time
argsparser = argparse.ArgumentParser(description="Null exporter LJ")
argsparser.add_argument("-v","--verbose",action="store_true",help="Verbose")
args = argsparser.parse_args()
verbose=args.verbose
name = "exports::toNull"
def debug(*args, **kwargs):
if( verbose == False ):
return
print(*args, file=sys.stderr, **kwargs)
try:
while True:
line = sys.stdin.readline()
if line == "":
time.sleep(0.01)
debug(name,"dumping: "+line)
except EOFError:
debug("break")# no more information