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

[💡 Feature]: Add spec file name to the prefix of log file names #12444

Open
1 task done
WillBrock opened this issue Mar 6, 2024 · 3 comments
Open
1 task done

[💡 Feature]: Add spec file name to the prefix of log file names #12444

WillBrock opened this issue Mar 6, 2024 · 3 comments
Labels
help wanted Issues that are free to take by anyone interested Idea 💡 A new feature idea

Comments

@WillBrock
Copy link
Member

WillBrock commented Mar 6, 2024

Is your feature request related to a problem?

When you have a lot of files in a test run it can be hard to find what log file applies to what test. You can grep the files to get what you're looking for but having the test file name be in the log file name could help.

Describe the solution you'd like.

Log files are outputted like the following format:

wdio-0-0.log
wdio-0-123-chromedriver.log
wdio-0-123-browser.log

There is no distinction on what tests those logs are for without looking inside the files. If the test file name is test-something.ts then the logs could look something like:

test-something-0-0.log
test-something-0-123-chromedriver.log
test-something-0-123-browser.log

This could also be a flag you set to have the log files outputted this way.

Describe alternatives you've considered.

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@WillBrock WillBrock added Needs Triaging ⏳ No one has looked into the issue yet Idea 💡 A new feature idea labels Mar 6, 2024
@WillBrock
Copy link
Member Author

This could likely be achieved if the outputFileFormat can be used for the global wdio logs. Currently it looks like that will only work for reporters logging.

[`test`, {
	outputDir              : `./logs`,
	outputFileFormat : (opts) => `${opts.spec[0].replace(`/.js|.ts/`, ``)}-test-reporter.log`,
}]

@christian-bromann
Copy link
Member

Let's introduce this as a WebdriverIO config and have a central log file management. The function passed into the outputFileFormat should receive information about the config and a scope, e.g. the reporter or service it likes to create a config file for so that someone can craft arbitrary names for the log file. This means that if someone would provide a outputFileFormat like so: () => 'allInOne.log' all logs would be written in a central file.

@christian-bromann christian-bromann added help wanted Issues that are free to take by anyone interested and removed Needs Triaging ⏳ No one has looked into the issue yet labels Mar 6, 2024
@wdio-bot
Copy link
Contributor

wdio-bot commented Mar 6, 2024

Thanks for reporting!

We greatly appreciate any contributions that help resolve the bug. While we understand that active contributors have their own priorities, we kindly request your assistance if you rely on this bug being fixed. We encourage you to take a look at our contribution guidelines or join our friendly Discord development server, where you can ask any questions you may have. Thank you for your support, and cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues that are free to take by anyone interested Idea 💡 A new feature idea
Projects
None yet
Development

No branches or pull requests

3 participants