From b1fd30fc3bbaa3adc0c9d61a066feb7e7d739cf7 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Wed, 1 May 2024 09:20:03 -0400 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Skip=20string=20prep=20if?= =?UTF-8?q?=20no=20log=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ceedling/loginator.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ceedling/loginator.rb b/lib/ceedling/loginator.rb index 299e9231..4db964fb 100644 --- a/lib/ceedling/loginator.rb +++ b/lib/ceedling/loginator.rb @@ -73,11 +73,13 @@ def out(string, verbosity=Verbosity::NORMAL, label=LogLabels::AUTO, stream=nil) # Choose appropriate console stream stream = get_stream( verbosity, stream ) - # Add labels - file_str = format( string.dup(), verbosity, label, false ) + if @project_logging + # Add labels + file_str = format( string.dup(), verbosity, label, false ) - # Write to log as though Verbosity::DEBUG (no filtering at all) but without fun characters - logfile( sanitize( file_str, false ), extract_stream_name( stream ) ) + # Write to log as though Verbosity::DEBUG (no filtering at all) but without fun characters + logfile( sanitize( file_str, false ), extract_stream_name( stream ) ) + end # Only output to console when message reaches current verbosity level return if !(@verbosinator.should_output?( verbosity )) @@ -183,8 +185,6 @@ def extract_stream_name(stream) def logfile(string, heading='') - return if not @project_logging - output = "#{heading} | #{@system_wrapper.time_now}\n#{string.strip}\n" @file_wrapper.write( @log_filepath, output, 'a' )