Skip to content

Log timestamps in the bootstrap scripts #8113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Utilities/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import platform
import re
import shutil
import subprocess
from helpers import note, error, symlink_force, mkdir_p, call, call_output
from helpers import note, error, symlink_force, mkdir_p, call, call_output, log_timestamp

g_macos_deployment_target = '12.0'

Expand Down Expand Up @@ -840,4 +840,6 @@ def get_swiftpm_flags(args):
return build_flags

if __name__ == '__main__':
log_timestamp("start")
main()
log_timestamp("end")
6 changes: 6 additions & 0 deletions Utilities/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,23 @@
##
##===----------------------------------------------------------------------===##

import datetime
import subprocess
import sys
import os
import errno

def log_timestamp(marker):
print("--- %s: note: %s %s" % (os.path.basename(sys.argv[0]), marker, datetime.datetime.now().isoformat()))

def note(message):
print("--- %s: note: %s" % (os.path.basename(sys.argv[0]), message))
log_timestamp("timestamp")
sys.stdout.flush()

def error(message):
print("--- %s: error: %s" % (os.path.basename(sys.argv[0]), message))
log_timestamp("timestamp")
sys.stdout.flush()
raise SystemExit(1)

Expand Down