Skip to content
Closed
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
3 changes: 1 addition & 2 deletions dashscope/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ class Oss:
@classmethod
def upload(cls, args):
print(
f"Start oss.upload: model={args.model}, file={args.file}, "
f"api_key={args.api_key}",
f"Start oss.upload: model={args.model}, file={args.file}",
)
Comment on lines 227 to 229

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this change correctly removes the API key from being logged, which is a critical security improvement, it's worth noting that using print() for logging application status is not ideal. It would be better to use a proper logging framework, like Python's logging module. This would provide more flexibility, such as controlling log verbosity and directing logs to different outputs (e.g., stderr or a file), separating them from the primary output of the CLI tool. The project already seems to have a logger set up in other modules (e.g., dashscope.utils.oss_utils), which could be leveraged here as well for better consistency.

if not args.file or not args.model:
print("Please specify the model and file path")
Expand Down
Loading