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

Log Types #163

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

spydercapriani
Copy link

Details

Opens up the parsing feature to more LogTypes.

Idea behind this approach is to make it easier to parse things like Package logs so as to potentially allow metric collection around dependencies. For example, Package + Build Logs can provide a deeper picture of what developement cycle looks like since package resolution happen before builds take place but aren't necessarily being accounted for.

CryptoSwift: 1.3.3 -> 1.4.2
ArgumentParser: 0.3.1 -> 1.0.3
Signed-off-by: Danny Gilbert <[email protected]>
Signed-off-by: Danny Gilbert <[email protected]>
Allow consumers to specify different logsDir

Signed-off-by: Danny Gilbert <[email protected]>
Allow consumers to inject modified LogFinders

Signed-off-by: Danny Gilbert <[email protected]>
Allow consumers to specify which logs they would like to parse. By default this will still apply to build logs.

Allows consumers to parse things like Package resolution logs.

Signed-off-by: Danny Gilbert <[email protected]>
@spydercapriani
Copy link
Author

Example:
xclogparser parse --project XCLogParser --reporter json --logs Package

This will parse the latest package resolution log for the project.

Return list of file URLs for log dir.

Signed-off-by: Danny Gilbert <[email protected]>
Offer filtering for logs newer than specifed date

Signed-off-by: Danny Gilbert <[email protected]>
Path is case sensitive for tests but not in real world use

Signed-off-by: Danny Gilbert <[email protected]>
Signed-off-by: Danny Gilbert <[email protected]>
Copy link
Collaborator

@PatrikBillgren PatrikBillgren left a comment

Choose a reason for hiding this comment

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

Thanks for submitting the PR! I have a few comments and questions. I also see there are a few Swiftlint warnings

@@ -26,6 +26,9 @@ struct DumpCommand: ParsableCommand {
commandName: "dump",
abstract: "Dumps the xcactivitylog file into a JSON document"
)

@Option(name: .long, help: "Type of .xactivitylog file to look for.")
var logs: LogType = .build
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggestion:
Rename this variable to logType . (Same for ManifestCommand.swift and ParseCommand.swift)

@@ -26,6 +26,9 @@ struct DumpCommand: ParsableCommand {
commandName: "dump",
abstract: "Dumps the xcactivitylog file into a JSON document"
)

@Option(name: .long, help: "Type of .xactivitylog file to look for.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think about printing the available option values here as well to make it easier for the user?

return try URL(fileURLWithPath: getLatestLogInDir(projectDir))

}

public func findLatestLogsWithLogOptions(_ logOptions: LogOptions) throws -> [URL] {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see this function is not used, was it supposed to be part of a refactor?

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