diff options
author | Grant Shangreaux <grant@unabridgedsoftware.com> | 2022-07-12 16:34:53 -0500 |
---|---|---|
committer | Grant Shangreaux <grant@unabridgedsoftware.com> | 2022-07-12 16:34:53 -0500 |
commit | 79dd7f85720d2402634304530d446f24b920839d (patch) | |
tree | 8c5253ffd2d8f3c81351f8d6fe6ad579afb44f37 /scopes/lspace.rb |
Add: scopes-and-bindings talkmaster
Diffstat (limited to 'scopes/lspace.rb')
-rwxr-xr-x | scopes/lspace.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scopes/lspace.rb b/scopes/lspace.rb new file mode 100755 index 0000000..cf027e1 --- /dev/null +++ b/scopes/lspace.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'lspace' + +def log(str) + puts "#{LSpace[:log_prefix]}: #{str}" +end + +def handle_request(req) + LSpace.with(log_prefix: "handling request") do + log Time.now + log req[:status] + log req[:body] + end + + Lspace.with(log_prefix: "app") do + log "request handled" + end +end + +handle_request({status: 200, body: "success!"}) |