Skip to content

Commit ffd5a9a

Browse files
committed
Tidy - remove logging statements
1 parent 06fe62a commit ffd5a9a

File tree

4 files changed

+0
-68
lines changed

4 files changed

+0
-68
lines changed

app/server/ruby/lib/sonicpi/lang/core.rb

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2301,9 +2301,6 @@ def live_loop(name=nil, *args, &block)
23012301

23022302
start_live_loop = Promise.new
23032303
parent_thread = Thread.current
2304-
# lg ""
2305-
# lg "live_loop creation w/: #{Thread.current.object_id} -> #{__system_thread_locals.get(:sonic_pi_local_parent_thread).object_id}"
2306-
# lg "======================"
23072304
mk_live_loop = lambda do
23082305
in_thread(name: ll_name, delay: delay, sync: sync_sym, sync_bpm: sync_bpm_sym) do
23092306

@@ -2314,7 +2311,6 @@ def live_loop(name=nil, *args, &block)
23142311
else
23152312
res = 0
23162313
end
2317-
lg "LL #{name} - started - [#{Thread.current.object_id}] -> #{__system_thread_locals.get(:sonic_pi_local_parent_thread).object_id}"
23182314
use_random_seed args_h[:seed] if args_h[:seed]
23192315

23202316
loop do
@@ -2340,31 +2336,15 @@ def live_loop(name=nil, *args, &block)
23402336
old_bus = __system_thread_locals.get :sonic_pi_mod_sound_synth_out_bus
23412337
__system_thread_locals.set(:sonic_pi_mod_sound_synth_out_bus, new_bus)
23422338
__system_thread_locals.set(:sonic_pi_mod_sound_job_group, new_group)
2343-
2344-
lg ""
2345-
lg "live_loop #{Thread.current.object_id} "
2346-
lg " - parent: #{__system_thread_locals.get(:sonic_pi_local_parent_thread).object_id}"
2347-
lg " - sending moved signal"
2348-
lg " - moved bus from #{old_bus} -> #{new_bus}"
2349-
lg " - move completed ack: #{ack_prom.object_id}"
2350-
lg ""
23512339
moved_prom.deliver! tracker
2352-
lg "....waiting for ack"
23532340
ack_prom.get
2354-
lg "....got ack"
23552341
__system_thread_locals.set_local :sonic_pi_local_spider_thread_moved, new_thread_moved_prom
23562342
__system_thread_locals.set_local :sonic_pi_local_spider_thread_moved_ack, new_thread_moved_ack_prom
23572343
__system_thread_locals.set_local :sonic_pi_local_live_loop_move_to_bus_and_parent_t, nil
23582344
new_job_id = __system_thread_locals(new_parent_t).get(:sonic_pi_spider_job_id)
23592345
job_subthread_move_named(Thread.current, new_job_id, ll_name)
23602346
__remove_thread_from_parent_subthreads!(Thread.current)
23612347
__move_thread_to_new_parent!(Thread.current, new_parent_t)
2362-
lg ""
2363-
lg "live_loop #{Thread.current.object_id} "
2364-
lg " - parent: #{__system_thread_locals.get(:sonic_pi_local_parent_thread).object_id}"
2365-
lg " - moved to bus: #{current_out_bus}"
2366-
2367-
lg ""
23682348
completed_prom.deliver! :moved
23692349
end
23702350
__live_loop_cue name if __system_thread_locals.get :sonic_pi_local_live_loop_auto_cue
@@ -2389,7 +2369,6 @@ def live_loop(name=nil, *args, &block)
23892369
move_holding_thread_prom = Promise.new
23902370
Thread.new do
23912371
__system_thread_locals.set_local :sonic_pi_local_thread_group, "ll swapper and holding thread for #{name} #{st}"
2392-
lg "LL[#{Thread.current.object_id}] #{name} - move - [#{st.object_id}] -> #{parent_thread.object_id} - ST:#{Thread.current.object_id}"
23932372
completed_prom = Promise.new
23942373

23952374

@@ -2399,7 +2378,6 @@ def live_loop(name=nil, *args, &block)
23992378

24002379
_b, _g, t, p = __system_thread_locals(st).get(:sonic_pi_local_live_loop_move_to_bus_and_parent_t)
24012380
if p
2402-
lg "CLOBBERING #{t.object_id} #{__system_thread_locals(t).get(:sonic_pi_local_thread_group)} #{p.object_id}"
24032381
## another live loop already registered a move, but didn't manage to swap in time - so we're going to clobber it
24042382
p.deliver! :clobbered
24052383
end
@@ -2421,8 +2399,6 @@ def live_loop(name=nil, *args, &block)
24212399
ct2.kill
24222400

24232401
if moved_or_clobbered == :moved
2424-
lg "LL[#{Thread.current.object_id}] #{name} - moved - [#{st.object_id}] - ST:#{Thread.current.object_id}"
2425-
24262402
st_joined_or_moved_again = Promise.new
24272403
mt1 = Thread.new do
24282404
__system_thread_locals.set_local :sonic_pi_local_thread_group, "ll join waiter for #{name} #{st.object_id} #{__system_thread_locals(st).get(:sonic_pi_local_thread_group)}"
@@ -2434,17 +2410,12 @@ def live_loop(name=nil, *args, &block)
24342410
__system_thread_locals.set_local :sonic_pi_local_thread_group, "ll move waiter for #{name} #{st.object_id} #{__system_thread_locals(st).get(:sonic_pi_local_thread_group)}"
24352411

24362412
ack_p = __system_thread_locals(st).get(:sonic_pi_local_spider_thread_moved_ack)
2437-
lg "LL[#{Thread.current.object_id}] #{name} - waiting for move again - [#{st.object_id}] - ack_p: #{ack_p.object_id}"
24382413
ack_p.get
24392414
st_joined_or_moved_again.deliver! true, false
24402415
end
2441-
lg "LL[#{Thread.current.object_id}] #{name} - KA - [#{st.object_id}] -> #{parent_thread.object_id} - ST:#{Thread.current.object_id}"
24422416
st_joined_or_moved_again.get
2443-
lg "LL[#{Thread.current.object_id}] #{name} - Done - [#{st.object_id}] -> #{parent_thread.object_id} - ST:#{Thread.current.object_id}"
24442417
mt1.kill
24452418
mt2.kill
2446-
else
2447-
lg "LL[#{Thread.current.object_id}] #{name} - clobbered - [#{st.object_id}] - ST:#{Thread.current.object_id}"
24482419
end
24492420
move_holding_thread_prom.deliver! true
24502421
end

app/server/ruby/lib/sonicpi/lang/sound.rb

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,34 +1815,22 @@ def with_fx(fx_name, *args, &block)
18151815
kill_delay = args_h[:kill_delay] || 1
18161816
end
18171817

1818-
lg "FX #{fx_name} - waiting #{subthreads.size} - #{new_bus}"
1819-
18201818
subthreads.map do |st|
1821-
1822-
18231819
Thread.new do
18241820
__system_thread_locals.set_local :sonic_pi_local_thread_group, "wfx subthread waiter for #{fx_name} #{new_bus}"
18251821
subthread_completed_or_moved = Promise.new
18261822
wt1 = Thread.new do
18271823
__system_thread_locals.set_local :sonic_pi_local_thread_group, "wfx join waiter for #{fx_name} #{new_bus}"
18281824
st.join
18291825
__system_thread_locals(st).get(:sonic_pi_local_spider_subthread_empty).get
1830-
lg " --> FX #{fx_name} - GC Joined - #{new_bus} - ST:#{st.object_id}"
18311826
subthread_completed_or_moved.deliver! true
18321827
end
18331828
wt2 = Thread.new do
18341829
__system_thread_locals.set_local :sonic_pi_local_thread_group, "wfx move waiter for #{fx_name} #{new_bus}"
18351830
p = __system_thread_locals(st).get(:sonic_pi_local_spider_thread_moved)
1836-
lg " --> FX #{fx_name} - GC Wait - #{new_bus} - ST:#{st.object_id} P:#{p.object_id} "
1837-
# lg "wfx [#{fx_name}] - waiting for thread moved #{st.class.inspect} - #{st.object_id}"
1838-
#
18391831
tracker_from_moved_thread = p.get
1840-
lg " --> wfx [#{fx_name}] - bus:#{new_bus.id} delivering prom:#{__system_thread_locals(st).get(:sonic_pi_local_spider_thread_moved_ack).object_id}"
18411832
__system_thread_locals(st).get(:sonic_pi_local_spider_thread_moved_ack).deliver! true, false
1842-
# lg "wfx [#{fx_name}] - waiting on tracker #{tracker.object_id}"
18431833
tracker_from_moved_thread.get
1844-
# lg "wfx [#{fx_name}] - tracker completed #{tracker.object_id}"
1845-
lg " --> FX #{fx_name} - GC Moved - #{new_bus} - #{st.object_id}"
18461834
subthread_completed_or_moved.deliver! true
18471835
end
18481836
subthread_completed_or_moved.get
@@ -1852,11 +1840,8 @@ def with_fx(fx_name, *args, &block)
18521840
end.each do |jt|
18531841
jt.join
18541842
end
1855-
lg "FX #{fx_name} - trk await - #{new_bus} - trk:#{tracker.object_id}"
18561843
tracker.block_until_finished
18571844
Kernel.sleep(kill_delay)
1858-
lg "FX #{fx_name} - completed - #{new_bus}"
1859-
lg "FX #{fx_name} - killing - #{new_bus}"
18601845
fx_container_group.kill(true)
18611846
end
18621847

@@ -1886,8 +1871,6 @@ def with_fx(fx_name, *args, &block)
18861871
__system_thread_locals.set(:sonic_pi_mod_sound_synth_out_bus, new_bus)
18871872
__system_thread_locals.set_local(:sonic_pi_local_mod_fx_tracker, tracker)
18881873

1889-
lg "FX #{fx_name} - created - #{new_bus}"
1890-
18911874
begin
18921875
if block.arity == 0
18931876
args_h[:reps].times do

app/server/ruby/lib/sonicpi/runtime.rb

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,6 @@ def __spider_eval(code, info={})
933933
Thread.current.priority = 20
934934
begin
935935
num_running_jobs = register_job!(id, Thread.current)
936-
lg "registering job #{id} with #{num_running_jobs} running jobs"
937936
__system_thread_locals.set_local :sonic_pi_local_thread_group, "job-#{id}"
938937
__system_thread_locals.set_local :sonic_pi_spider_thread_id_path, ThreadId.new(id)
939938
__system_thread_locals.set_local :sonic_pi_spider_num_threads_spawned, 0
@@ -954,16 +953,8 @@ def __spider_eval(code, info={})
954953
end
955954
__info "Starting run #{id}" unless silent
956955
code = PreParser.preparse(code, SonicPi::Lang::Core.vec_fns)
957-
lg "\n\n"
958-
lg " EVAL #{Thread.current.object_id} - NThreads: #{Thread.list.size}"
959-
lg " - n-threads: #{Thread.list.size}"
960-
Thread.list.sort_by(&:object_id).map{|t| lg " [#{t.object_id}] -> #{__system_thread_locals(t).get(:sonic_pi_local_thread_group)}"}
961-
962956
job_in_thread = __in_thread seed: 0 do
963-
lg " spider eval #{Thread.current.object_id} -> #{__system_thread_locals.get(:sonic_pi_local_parent_thread).object_id}"
964-
STDOUT.flush
965957
with_fx :level, amp: 1 do
966-
967958
eval(code, nil, info[:workspace], firstline)
968959
end
969960
end
@@ -1164,12 +1155,7 @@ def __in_thread(*opts, &block)
11641155
__system_thread_locals.set_local(:sonic_pi_local_spider_thread_moved, Promise.new)
11651156
__system_thread_locals.set_local(:sonic_pi_local_spider_thread_move_mut, Mutex.new)
11661157

1167-
# lg "\n====> in-thread"
1168-
# lg "New thread #{Thread.current.object_id} as child of #{parent_t.object_id}"
1169-
STDOUT.flush
11701158
__system_thread_locals.set_local(:sonic_pi_local_parent_thread, parent_t)
1171-
# lg "New thread #{Thread.current.object_id} -> #{__system_thread_locals.get(:sonic_pi_local_parent_thread).object_id}"
1172-
STDOUT.flush
11731159

11741160
# Wait for parent to deliver promise. Throws an exception if
11751161
# parent dies before the promise is delivered, thus stopping
@@ -1348,7 +1334,6 @@ def job_subthread_add_unmutexed(job_id, t, name=nil)
13481334
end
13491335

13501336
def job_subthread_move_named_unmutexed(t, new_job_id, name)
1351-
lg "Moving thread #{name} to job #{new_job_id}"
13521337
named_thread = @named_subthreads[name]
13531338
raise unless named_thread
13541339
raise unless named_thread.thread == t

app/server/ruby/lib/sonicpi/util.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,6 @@ def fetch_url(url, anonymous_uuid=true)
224224

225225
end
226226

227-
def lg(s)
228-
# time = Time.now
229-
# formatted_time = time.strftime("%H:%M:%S") + ".#{time.strftime("%L")}"
230-
# Kernel.puts "[#{formatted_time}] #{s}"
231-
# STDOUT.flush
232-
end
233-
234227
def log_raw(s)
235228
if @@log_file
236229
@@log_file.write("[#{Time.now.strftime("%Y-%m-%d %H:%M:%S")}] #{s}")

0 commit comments

Comments
 (0)