Skip to content

Commit

Permalink
feat: Log configs (#225)
Browse files Browse the repository at this point in the history
Log simplified versions of the config files to stderr. May be useful in
services, to look at logs later to understand when configs changed, and
how they may have impacted performance.
  • Loading branch information
joeyparrish authored Jan 15, 2025
1 parent 3e78b77 commit c2244c0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions shaka-streamer
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ https://shaka-project.github.io/shaka-streamer/
"""

import argparse
import json
import sys
import time
import yaml
Expand Down Expand Up @@ -84,6 +85,12 @@ See docs: https://shaka-project.github.io/shaka-streamer/cloud_storage.html
help='Use FFmpeg, FFprobe and Shaka Packager binaries ' +
'found in PATH instead of the ones offered by ' +
'Shaka Streamer.')
parser.add_argument('--log-configs',
action='store_true',
help='Log simplified versions of the config files to ' +
'stderr. May be useful in services, to look at ' +
'logs later to understand when configs changed, ' +
'and how they may have impacted performance.')

args = parser.parse_args()

Expand All @@ -100,6 +107,14 @@ See docs: https://shaka-project.github.io/shaka-streamer/cloud_storage.html
with open(args.bitrate_config) as f:
bitrate_config_dict = yaml.safe_load(f)

if args.log_configs:
configs = {
'input': input_config_dict,
'pipeline': pipeline_config_dict,
'bitrate': bitrate_config_dict,
}
print('Configs: {}'.format(json.dumps(configs)), file=sys.stderr)

try:
if args.cloud_url:
print('Warning: -c/--cloud-url is deprecated; use -o/--output instead',
Expand Down

0 comments on commit c2244c0

Please sign in to comment.