Skip to content

Commit

Permalink
⚡️ Skip string prep if no log file
Browse files Browse the repository at this point in the history
  • Loading branch information
mkarlesky authored May 1, 2024
1 parent d9cb5e3 commit b1fd30f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/ceedling/loginator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 ))
Expand Down Expand Up @@ -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' )
Expand Down

0 comments on commit b1fd30f

Please sign in to comment.