gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libextractor-python] branch master updated: attempt


From: gnunet
Subject: [GNUnet-SVN] [libextractor-python] branch master updated: attempt
Date: Sun, 17 Jun 2018 16:20:07 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository libextractor-python.

The following commit(s) were added to refs/heads/master by this push:
     new a4763e6  attempt
a4763e6 is described below

commit a4763e6617dc5420939f94c0183030b94c5b010a
Author: Nils Gillmann <address@hidden>
AuthorDate: Sun Jun 17 14:20:39 2018 +0000

    attempt
    
    Signed-off-by: Nils Gillmann <address@hidden>
---
 libextractor/examples/__main__.py | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/libextractor/examples/__main__.py 
b/libextractor/examples/__main__.py
index 91bab1d..d28b6e1 100644
--- a/libextractor/examples/__main__.py
+++ b/libextractor/examples/__main__.py
@@ -35,19 +35,35 @@ faulthandler.enable()
 
 xtract = extractor.Extractor()
 
+logger = logging.getLogger()
+logger.setLevel(logging.DEBUG)
+
+formatter = logging.Formater('%(asctime)s %(levelname)s - %(message)s')
+
+fh = logging.FileHandler('log.txt')
+fh.setLevel(logging.DEBUG)
+fh.setFormatter(formatter)
+logger.addHandler(fh)
+
+ch = logging.StreamHandler()
+ch.setLevel(logging.DEBUG)
+ch.setFormatter(formatter)
+logger.addHandler(ch)
+
 def print_k(xt, plugin, type, format, mime, data, datalen):
     mstr = cast(data, c_char_p)
     # FIXME: this ignores 'datalen', not that great...
     # (in general, depending on the mime type and format, only
     # the first 'datalen' bytes in 'data' should be used).
     if (format == extractor.EXTRACTOR_METAFORMAT_UTF8):
-        print("%s - %s" % (xtract.keywordTypes()[type], mstr.value))
+        # print("%s - %s" % (xtract.keywordTypes()[type], mstr.value))
+        logger.debug("%s - %s" % (xtract.keywordTypes()[type], mstr.value))
     return 0
 
 def main():
     # stuff
     for arg in sys.argv[1:]:
-        print("Keywords from %s:" % arg)
+        logger.debug("Keywords from %s:" % arg)
         xtract.extract(print_k, None, arg)
 
 if __name__ == "__main__":

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]