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

Add new types and functions to pillar needed by newlog and edge-view #4449

Merged
merged 3 commits into from
Nov 26, 2024

Conversation

europaul
Copy link
Contributor

This is a dependency required by #4413

@@ -295,6 +295,10 @@ const (
SyslogLogLevel GlobalSettingKey = "debug.syslog.loglevel"
// KernelLogLevel global setting key
KernelLogLevel GlobalSettingKey = "debug.kernel.loglevel"
// SyslogRemoteLogLevel global setting key
Copy link
Member

Choose a reason for hiding this comment

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

I don't know why we have this tradition of adding a useless comment to all the properties; it would make sense to stop and add something more meaningful (I'm trying to do it myself).

Copy link
Member

Choose a reason for hiding this comment

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

It would also be beneficial to add documentation for the new props in the same commit or in one that's close.
https://github.com/lf-edge/eve/blob/master/docs/CONFIG-PROPERTIES.md

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know why we have this tradition of adding a useless comment to all the properties; it would make sense to stop and add something more meaningful (I'm trying to do it myself).

It is a lint requirement to document all exported names. But we can put something more useful after the // SyslogRemoteLogLevel required prefix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would also be beneficial to add documentation for the new props in the same commit or in one that's close.

I'm doing it in my main PR #4413

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the comments to more meaningful descriptions

// DevPrefixUpload - file prefix string for device log files to upload
DevPrefixUpload = "dev.log.upload."
// DevPrefixKeep - file prefix string for device log files to keep on device
DevPrefixKeep = "dev.log.keep."
Copy link
Member

Choose a reason for hiding this comment

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

So, are we going to change the directories naming scheme?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no the directories themselves, but the files inside of them

@@ -81,3 +84,22 @@ type NewlogMetrics struct {
DevMetrics logfileMetrics // Device metrics
AppMetrics logfileMetrics // App metrics
}

// GetTimestampFromGzipName - get timestamp from gzip file name
func GetTimestampFromGzipName(fName string) (time.Time, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Then this should also replace this func, I guess?

func getTimeNumber(isApp bool, fName string) (bool, int) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

exactly, I'm doing this in the main PR #4413

Adds remote log levels for kernel and syslog logs:
- debug.syslog.remote.loglevel
- debug.kernel.remote.loglevel

Adds log levels "all" and "none": as the names suggest, "all" will log
everything and "none" will suppress all logs.

Signed-off-by: Paul Gaiduk <[email protected]>
Add new metrics for newlog:
- totalSizeLogs: total size of logs on device
- oldestSavedDeviceLog: timestamp of the latest device log saved on
device

Add new log file prefixes for device logs:
- "dev.log.upload.": device logs that are uploaded
- "dev.log.keep.": device logs that stay on the device

Signed-off-by: Paul Gaiduk <[email protected]>
Since the functionality is used across pillar, newlog and edgeview code,
it is better to have it in a separate file imported by all of them.

Signed-off-by: Paul Gaiduk <[email protected]>
Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

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

LGTM

@eriknordmark eriknordmark merged commit 16062e8 into lf-edge:master Nov 26, 2024
40 checks passed
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.

3 participants