Exploratory PR for backwards-compatible changes & cross-env alignment: timeFormat#915
Open
webketje wants to merge 4 commits intodebug-js:masterfrom
Open
Exploratory PR for backwards-compatible changes & cross-env alignment: timeFormat#915webketje wants to merge 4 commits intodebug-js:masterfrom
webketje wants to merge 4 commits intodebug-js:masterfrom
Conversation
…oss browser and Node * Adds timeFormat option to debug instances, settable as DEBUG_TIME_FORMAT env var * Deprecates hideDate option, equated to timeFormat === 'none' * Allows timeFormat of choice: none, iso, diff, or localized (taking into account process.env.TZ) * Normalizes behavior across browser & Node: all timeFormats are available in both, but the defaults are kept as-is. * Deprecates createDebug.humanize and adds createDebug.withTimeFormat helper instead
… be tested against both browser & NodeJS envs
Author
|
@Qix- feedback? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I started this effort because I was in sore need of localized dates (we have Java & Node microservices and it's a pain that one takes into account timezone while the other does not). Then I realized there was a lot more I could do that would be both backwards-compatible, more powerful and more aligned across browser and Node. So this PR:
@Qix- I was surprised at how outdated (dev)Dependencies are and was unable to run
npm test(onlymocha test.jsdirectly), and dind't find any CI script. The browserify build was not documented so I added an NPM script for it.. It may be useful to add it to the NPM files for those of us wanting to use debug in the browser by copying the dist to an asset folder. I think this change is fully backwards-compatible (at least all tests succeed including the 5 new ones I added)