-
Notifications
You must be signed in to change notification settings - Fork 43
Raw template logging implementation #1157
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
daneshk
merged 19 commits into
ballerina-platform:master
from
randilt:raw-template-logging-implementation
Jan 17, 2025
Merged
Changes from 15 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
bf894d7
[Automated] Update the native jar versions
randilt e656072
Update Ballerina.toml version and add raw template logging functionality
randilt 3c924f1
Add test for raw template check (ERROR LEVEL)
randilt cb4e339
Enhance logging messages in raw template with prefixes and add tests …
randilt 146da42
Revert autoformat
randilt 80085d6
Fix regex syntax in logfmt test cases for consistent line splitting
randilt 678ae26
Update Ballerina.toml and logfmt tests to use dynamic versioning and …
randilt b40b92d
Fix indentation in logfmt test cases for improved readability
randilt 436adcf
Fix formatting in exec function signature for consistency
randilt d54ed1e
Apply suggestions from code review
randilt 113f52c
Add comment for raw templates in logging for clarity
randilt 6cc6993
Merge branch 'raw-template-logging-implementation' of https://github.…
randilt 6878232
Refactor logging functions to directly print messages and enhance log…
randilt f2c2b1d
Simplify value assignment in print function using ternary operators f…
randilt 7abe611
Refactor print function to always process messages, simplifying messa…
randilt cf176c1
Refactor processMessage function to use a concise arrow function synt…
randilt 5378507
Change insertions type in PrintableRawTemplate from anydata[] to Valu…
randilt e4147fd
Add support for logging raw template values in log APIs and update re…
randilt 3ec3b58
Update printDebug function documentation
randilt 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
28 changes: 28 additions & 0 deletions
28
integration-tests/tests/resources/samples/log-levels-raw-template/main.bal
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,28 @@ | ||
| // Copyright (c) 2021 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. | ||
| // | ||
| // WSO2 Inc. licenses this file to you 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. | ||
|
|
||
| import ballerina/log; | ||
|
|
||
| public function main() { | ||
| string myname = "Alex92"; | ||
| int myage = 25; | ||
| log:printError(string `error: My name is ${myname} and my age is ${myage}`); | ||
| log:printWarn(string `warning: My name is ${myname} and my age is ${myage}`); | ||
| log:printInfo(string `info: My name is ${myname} and my age is ${myage}`); | ||
| log:printDebug(string `debug: My name is ${myname} and my age is ${myage}`); | ||
| log:printInfo("User details", details = string `name: ${myname}, age: ${myage}`); | ||
| } | ||
|
|
||
TharmiganK marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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.