Module: OpenSandbox::LogUtils

Defined in:
lib/open_sandbox/models.rb

Overview

Utility helpers for processing sandbox output.

Constant Summary collapse

TIMESTAMP_RE =

Strip Docker-style RFC3339 nanosecond timestamp prefixes from each log line.

"2026-04-29T13:37:33.993340334Z 1024\n"  =>  "1024\n"
"no-timestamp\n"                         =>  "no-timestamp\n"
/\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z /.freeze

Class Method Summary collapse

Class Method Details

.strip_timestamps(raw) ⇒ Object



120
121
122
# File 'lib/open_sandbox/models.rb', line 120

def self.strip_timestamps(raw)
  raw.to_s.lines.map { |line| line.sub(TIMESTAMP_RE, "") }.join
end