Skip to content
Snippets Groups Projects
Commit c907d472 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Print the size of generated reports if possible.

parent 5e80c6ab
No related branches found
No related tags found
No related merge requests found
......@@ -16,9 +16,11 @@
# You should have received a copy of the GNU General Public License
# along with diffoscope. If not, see <https://www.gnu.org/licenses/>.
import os
import logging
from ..profiling import profile
from ..utils import format_bytes
from .text import TextPresenter
from .json import JSONPresenter
......@@ -102,6 +104,17 @@ class PresenterManager:
with profile("output", name):
data["klass"].run(data, difference, parsed_args)
size = "n/a"
if os.path.isfile(data["target"]):
size = format_bytes(os.path.getsize(data["target"]))
logger.debug(
"Generated %r output at %r (size: %s)",
name,
data["target"],
size,
)
def compute_visual_diffs(self):
"""
Don't waste time computing visual differences if we won't use them.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment