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

docs: Add troubleshooting doc (logging) #704

Merged
merged 1 commit into from
Dec 15, 2024

Conversation

tienvx
Copy link
Contributor

@tienvx tienvx commented Dec 13, 2024

Add document for this change #689

@tienvx tienvx requested review from JP-Ellis and YOU54F December 13, 2024 11:48
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12315086252

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 96.3%

Totals Coverage Status
Change from base Build 12130132873: 0.0%
Covered Lines: 2577
Relevant Lines: 2676

💛 - Coveralls

Copy link
Member

@YOU54F YOU54F left a comment

Choose a reason for hiding this comment

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

nice! can users set env var in their shell outside of any code?

@tienvx
Copy link
Contributor Author

tienvx commented Dec 15, 2024

can users set env var in their shell outside of any code?

Yes, they can if they customize the code a bit:

use PhpPact\Log\Logger;
use PhpPact\Log\Enum\LogLevel;
$logger = Logger::instance();
$level = \getenv('PACT_LOGLEVEL');
$logger->attach(new File(\getenv('PACT_LOG'), LogLevel::from($level)));
$logger->attach(new Buffer(LogLevel::from($level)));
$logger->attach(new Stdout(LogLevel::from($level)));
$logger->attach(new Stderr(LogLevel::from($level)));
$logger->apply();
use PhpPact\Standalone\MockService\MockServerConfig;
$config->setLogLevel(\getenv('PACT_LOGLEVEL'));
use PhpPact\Standalone\ProviderVerifier\Model\VerifierConfig;
$config->setLogLevel(\getenv('PACT_LOGLEVEL'));

@tienvx tienvx merged commit efac99f into pact-foundation:master Dec 15, 2024
20 checks passed
@tienvx tienvx deleted the add-troubleshooting-doc branch December 15, 2024 01:12
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