-
Notifications
You must be signed in to change notification settings - Fork 607
Debug mode, see more logs with ?debug=true #369
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
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
2125bd1
debug mode
12f7c8d
format
2f33731
address comment
b52a709
address comment
ed57aec
add newline
664d5d3
address some comments
3b8cc21
add debug url to cx get
1vn b76f1ff
Merge branch 'debug-mode' of github.com:cortexlabs/cortex into debug-…
1vn 311c534
move url prompt up
1vn d3ba1d5
Merge branch 'master' into debug-mode
1vn ba100be
Update apis.md
ospillinger e81fa28
improve debug
1vn 4a50dbc
Merge branch 'debug-mode' of github.com:cortexlabs/cortex into debug-…
1vn e4e65b6
improve debug
1vn 49d4b96
improve debug
1vn c33de74
format
1vn 7b3f97b
merge master
1vn aa8e7c2
add sig key
1vn 9ce48fb
update docs
1vn 0476687
add to onnx
1vn 152e15a
fix print
1vn 3ff713d
merge master
1vn 4724a35
format
1vn d3aa769
clean up unused functions, make stringify python package
1vn 46a2954
ckean up unused function
1vn 06b752c
remove constant
1vn 4dad214
format
1vn 7db5461
improve debug
1vn 39df4f7
improve debug
1vn 4557054
move quote at the end
1vn 8e71f18
remove pprint
1vn 9ea6ea1
exact args
1vn 767440b
Merge branch 'master' into debug-mode
deliahu 0af3d6a
print_obj -> debug_obj
deliahu e017e7a
Update stringify.py
deliahu 607cfb9
Update stringify.py
deliahu 3fe8959
Update stringify.py
deliahu 931915e
Update stringify.py
deliahu 46e7ce8
Update stringify.py
deliahu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Copyright 2019 Cortex Labs, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from collections.abc import Iterable | ||
|
||
|
||
def truncate(item, max_elements=10, max_str_len=500): | ||
if isinstance(item, str): | ||
s = item | ||
if max_str_len > 3 and len(s) > max_str_len: | ||
s = s[: max_str_len - 3] + "..." | ||
return '"{}"'.format(s) | ||
|
||
if isinstance(item, dict): | ||
count = 0 | ||
item_strs = [] | ||
for key in item: | ||
if max_elements > 0 and count >= max_elements: | ||
item_strs.append("...") | ||
break | ||
|
||
key_str = truncate(key, max_elements, max_str_len) | ||
val_str = truncate(item[key], max_elements, max_str_len) | ||
item_strs.append("{}: {}".format(key_str, val_str)) | ||
count += 1 | ||
|
||
return "{" + ", ".join(item_strs) + "}" | ||
|
||
if isinstance(item, Iterable) and hasattr(item, "__getitem__"): | ||
item_strs = [] | ||
|
||
for element in item[:max_elements]: | ||
item_strs.append(truncate(element, max_elements, max_str_len)) | ||
|
||
if max_elements > 0 and len(item) > max_elements: | ||
item_strs.append("...") | ||
|
||
return "[" + ", ".join(item_strs) + "]" | ||
|
||
# Fallback | ||
s = str(item) | ||
if max_str_len > 3 and len(s) > max_str_len: | ||
s = s[: max_str_len - 3] + "..." | ||
return s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.