Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

joelwurtz
Copy link
Member

@joelwurtz joelwurtz commented Aug 11, 2023

Add a new way to output log for castor which will do the following :

  • Create a "main" section where all users logs (using the log function) will go
  • For each run process create 2 new sections :
    • One for the progress
    • One for the log of the process
  • When a process is running it output it's content in the created section
  • When a process has finish running it clear its sections and add the content of thoses section in the main (top) section, this allow to have a history of each process in order even when there is parallelism

Currently this output is only available when using the CASTOR_USE_SECTION=true env variable, we can make this default later, but it will be better to first test this output and existing project as an expiremental approach so we can iterate on this with real use case

test-2023-08-11_18.08.05.webm

Need symfony/symfony#51355 to work
Need symfony/symfony#51378 for better output (too many new lines)

@joelwurtz joelwurtz force-pushed the feat/section-output branch from b0cd06d to f40bf64 Compare August 16, 2023 07:52
@joelwurtz joelwurtz marked this pull request as ready for review August 16, 2023 07:52
@joelwurtz joelwurtz changed the title feat(output): add a section output to track current running command Expiremental: add a section output to track current running command Aug 16, 2023
Copy link
Member

@pyrech pyrech left a comment

Choose a reason for hiding this comment

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

Awesome 🎉 Could you add a note in the changelog?

@@ -49,14 +49,19 @@ public static function getInput(): InputInterface
return self::$input ?? throw new \LogicException('Input not available yet.');
}

public static function setOutput(OutputInterface $output): void
Copy link
Member

Choose a reason for hiding this comment

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

Should the removal of this setter be considered as a BC-break?

Copy link
Member Author

Choose a reason for hiding this comment

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

maybe, but imo GlobalHelper is mainly used internally, maybe we should declare it like that instead ?

Copy link
Member

Choose a reason for hiding this comment

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

That's what I thought at first but then remembered that we offered some setter to configure the app globally like for the cache, logger or http client, so probably not so internal IMO

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe have custom function instead of using that then ? This class have both external / internal public methods from what i see, we should avoid that and provide a clean external entrypoint for this behavior, but not the subject of this PR,

@joelwurtz joelwurtz force-pushed the feat/section-output branch 2 times, most recently from 54b11bb to 1c37af8 Compare August 16, 2023 08:12
@joelwurtz joelwurtz force-pushed the feat/section-output branch from 1c37af8 to 9e4a628 Compare August 16, 2023 08:14
@joelwurtz joelwurtz merged commit 5fd58e8 into main Aug 16, 2023
@joelwurtz joelwurtz deleted the feat/section-output branch August 16, 2023 09:13
Copy link
Member

@lyrixx lyrixx left a comment

Choose a reason for hiding this comment

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

Cool 😎

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