ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
136 stars 64 forks source link

[Improvement]: Support for passing comma separated parameters to log functions #6846

Open chathurace opened 3 months ago

chathurace commented 3 months ago

Description

It's easier to write logs if we can allow passing multiple parameters separated by commas like: log:printDebug("Allocating items: ", allocation.itemId, " - ", allocation.quantity);

We can also differ concatenations until the log function invocation with this, which is useful for debug logs.

Describe your problem(s)

No response

Describe your solution(s)

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

logging

Suggested assignee(s) (optional)

No response

daneshk commented 3 months ago

@chathurace We do support passing key/value in the log function like below,

log:printDebug("Allocating items",  item = allocation.itemId, quantity = allocation.quantity);