Skip to content
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
1 change: 1 addition & 0 deletions e2e/fixtures/examples/02-http-client.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Fetching popular packages for query 'aws' from Ballerina Central...
Top <number> popular packages for query 'aws':
<package> (<number> pulls)
<package> (<number> pulls)
Expand Down
2 changes: 2 additions & 0 deletions examples/02-http-client/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ type SearchResult record {
public function main() returns error? {
string query = "aws";
http:Client registry = check new ("https://api.central.ballerina.io/2.0/registry");

io:println(string `Fetching popular packages for query '${query}' from Ballerina Central...`);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we use ballerina/log. I am not sure it is good to have mix of io and log.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

From connector team, we follow and recommend the convention to use io prints in main function examples and log statements for service examples.

http:Response res = check registry->get(string `/packages?q=${query}&limit=50`);
SearchResult result = check (check res.getJsonPayload()).fromJsonWithType();

Expand Down
Loading