Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging misses some information leaked to stdin #21

Open
Teebor-Choka opened this issue Nov 8, 2019 · 1 comment
Open

Logging misses some information leaked to stdin #21

Teebor-Choka opened this issue Nov 8, 2019 · 1 comment

Comments

@Teebor-Choka
Copy link
Contributor

While analyzing logs on a development setup I noticed that a lot if information is passed to stdin using the print() function. Some of the more crucial information (such as input check) did not even make it into logger facilities.

A preferable solution would be to use a dedicated (configurable) logger for each such output instead of the print() functions (those should be removed). The default destination for the logging could be set as stdin, which is by default captured on external systems.

Using logger allows to select the logging message granularity and allows easier debugging.

@Teebor-Choka
Copy link
Contributor Author

Some of the print() invocations that can be found by a fast grep (notice the Critical problem during execution {e} which never makes it to the log):

carlhauser_server/safe_launcher.py:                print("Press any key to stop ... ")
carlhauser_server/safe_launcher.py:                print("Are you sure you want to stop ? [yes/no] ")
carlhauser_server/safe_launcher.py:            print('Interruption detected')
carlhauser_server/safe_launcher.py:                print('Handling interruptions ...')
carlhauser_server/safe_launcher.py:            print(f'Critical problem during execution {e}')
carlhauser_server/safe_launcher.py:            print("Wait for the extinction ... ")
carlhauser_server/safe_launcher.py:            print("You should be nicer to carl-hauser.")
carlhauser_server/Helpers/bow_orb_vocabulary_creator.py:        print(f"Files list : {files[:5]}... from {pathlib.Path}")
carlhauser_server/Helpers/bow_orb_vocabulary_creator.py:            # print(f"Picture converted to CV2 UMAT {type(orb_pic)}")
carlhauser_server/Helpers/bow_orb_vocabulary_creator.py:                    print(f"Working on pictures {nb_corr_pictures} out of {len(files_list)}")
carlhauser_server/Helpers/bow_orb_vocabulary_creator.py:                print(f"Descriptors not usables for pictures : {curr_img_path} are {descriptors}")
carlhauser_server/Helpers/bow_orb_vocabulary_creator.py:        print(f"Nb Pictures processed : {nb_corr_pictures}")
carlhauser_server/Helpers/bow_orb_vocabulary_creator.py:        print(f"Nb Pictures discarded : {len(files_list) - nb_corr_pictures}")
carlhauser_server/Helpers/bow_orb_vocabulary_creator.py:        print(f"Saving vocabulary ...")
carlhauser_server/Helpers/bow_orb_vocabulary_creator.py:        print(type(vocab))
carlhauser_server/Helpers/bow_orb_vocabulary_creator.py:        print(vocab)
carlhauser_server/Helpers/bow_orb_vocabulary_creator.py:        print(f"Loading vocabulary ...")
carlhauser_server/DatabaseAccessor/database_requester.py:        print(make_small_line())
carlhauser_server/DatabaseAccessor/database_requester.py:        print("Requester Worker ready to accept more queries.")
carlhauser_server/DatabaseAccessor/database_adder.py:        print(make_small_line())
carlhauser_server/DatabaseAccessor/database_adder.py:        print("Adder Worker ready to accept more queries.")
carlhauser_server/DatabaseAccessor/database_worker.py:            print('Interruption detected')
carlhauser_server/DatabaseAccessor/database_worker.py:                print('DB Worker stopped brutally. You should not do that :( ...')
carlhauser_server/FeatureExtractor/feature_worker.py:        print(make_small_line())
carlhauser_server/FeatureExtractor/feature_worker.py:        print("Feature Worker ready to accept more queries.")
carlhauser_server/FeatureExtractor/feature_worker.py:        print("ARG_PARSER didn't do his job : you should provide a mode for the worker, to know what to do : from where to get pictures to hash, and here to where to put the result back")
carlhauser_server/instance_handler.py:        print("\n" + make_big_line())
carlhauser_server/instance_handler.py:        print("Server is running and ready to accept queries (if no error shown upper than this line).")
carlhauser_server/instance_handler.py:        print("Server is asked to stop, please wait until complete shutdown of the server by itself.")
carlhauser_server/instance_handler.py:        print("\n" + make_big_line())
carlhauser_server/instance_handler.py:        print("\n" + make_big_line())
carlhauser_server/instance_handler.py:        print("Server is stopped, correctly (if no error shown upper than this line).")
carlhauser_client/EvaluationTools/SimilarityGraphExtractor/similarity_graph_extractor.py:        print("Ground truth file detected.")
carlhauser_client/EvaluationTools/SimilarityGraphExtractor/similarity_graph_extractor.py:        print("Ground truth file not detected.")
carlhauser_client/EvaluationTools/SimilarityGraphExtractor/similarity_graph_quality_evaluator.py:            print(pformat(result))
carlhauser_client/EvaluationTools/SimilarityGraphExtractor/similarity_graph_quality_evaluator.py:                print(pformat(result))
carlhauser_client/EvaluationTools/SimilarityGraphExtractor/similarity_graph_quality_evaluator.py:            print(pformat(result))
carlhauser_client/API/extended_api.py:            print(f"Database fetched successfully.")
carlhauser_client/API/cli.py:        print(f"Uploading pictures from {args.path}")
carlhauser_client/API/cli.py:        print(f"{nb} pictures uploaded.")
carlhauser_client/API/cli.py:        print(f"Mapping file_name / Server ID saved to {args.mapfile}.")
carlhauser_client/API/cli.py:            print(f"Mapping file detected. Reversing the ids ... ")
carlhauser_client/API/cli.py:        print(f"Requesting server to dump its database")
carlhauser_client/API/cli.py:            print(f"Mapping file detected. Reversing the ids ... ")
carlhauser_client/API/cli.py:            print(args.copyids)
carlhauser_client/API/cli.py:            print(f"ID to image copy option detected. Copying ... ")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant