Skip to content
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

API for the new paginated "get application logs" #391

Merged
merged 2 commits into from
Apr 20, 2024
Merged

Conversation

apoliakov
Copy link
Member

No description provided.

logger.info(`No logs found for the specified parameters`);
} else {
logger.info(`Successfully retrieved logs of application: ${appName}`);
logger.info(res.data)
console.log(logResponse.body.trimEnd())
Copy link
Member

Choose a reason for hiding this comment

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

Should this be logger.info()?

Copy link
Member Author

@apoliakov apoliakov Apr 19, 2024

Choose a reason for hiding this comment

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

I changed this to console.log because logger.info adds its own [TIME][info]... prefix. These logs have a similar prefix already. So when paginating you'd see

[timestamp][info]: [inner_log_timestamp][info][body]
[inner_log_timestamp][info][body]
[inner_log_timestamp][info][body]
...
[timestamp][info]: [inner_log_timestamp][info][body]
[inner_log_timestamp][info][body]
[inner_log_timestamp][info][body]

I decided to essentially send the inner body of the logs to stdout "exactly as is". This seems most friendly for use cases like sending logs to some program for parsing. Does that make sense?

@apoliakov apoliakov merged commit 2597021 into main Apr 20, 2024
2 checks passed
@apoliakov apoliakov deleted the paginate-logs branch April 20, 2024 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants