dpogue opened a new pull request, #248:
URL: https://github.com/apache/cordova-common/pull/248

   ### Platforms affected
   All
   
   
   ### Motivation and Context
   <!-- Why is this change required? What problem does it solve? -->
   <!-- If it fixes an open issue, please link to the issue here. -->
   * Sometimes (particularly in cordova-ios test cases) it seems like the 
CordovaEventEmitter gets subscribed to CordovaLogger multiple times, resulting 
in duplicate log output lines.
   
   * Node 20.12.0 and newer include `util.styleText` for handling console text 
styling. Prefer to use stdlib functionality rather than external dependencies.
   
   
   ### Description
   <!-- Describe your changes in detail -->
   * Added a WeakMap to store subscribed emitters in CordovaLogger and no-op if 
the same emitter is subscribed more than once
   
   * If `util.styleText` is available, use that instead of the `ansi` module 
for formatting the CordovaLogger output.
     * In the next major, we can drop the `ansi` dependency and clean up the 
internals of CordovaLogger
   
   
   ### Testing
   <!-- Please describe in detail how you tested your changes. -->
   Added new test cases for changed code.
   
   Visually tested output with both `util.styleText` and `ansi` to confirm the 
output is identical.
   
   
   ### Checklist
   
   - [x] I've run the tests to see all new and existing tests pass
   - [x] I added automated test coverage as appropriate for this change


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to