Bug 54771 - change print to proper logging in import_computer
change print to proper logging in import_computer
Status: NEW
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS@school maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-05-18 16:45 CEST by Tobias Wenzel
Modified: 2022-06-08 09:13 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): bitesize, Cleanup
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Wenzel univentionstaff 2022-05-18 16:45:13 CEST
The computer import (ucsschool/ucs-school-import/usr/share/ucs-school-import/scripts/import_computer) uses print statements for logging.

This should be changed changed to a proper logging. At the same time we want to keep the logging output to the console.

Out of scope: other import scripts. This should be done one by one to keep the bug size small.

Hint: There is already some logic for this in the ucs-school-import for users, maybe this can be reused.
Comment 1 Daniel Tröder univentionstaff 2022-05-19 15:49:26 CEST
Please use ucsschool.lib.models.utils.get_stream_handler() and ...get_file_handler() for writing the log to stdout/stderr and log files