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

Option to prefix date to messages #3

Merged
merged 1 commit into from Aug 23, 2012
Merged

Option to prefix date to messages #3

merged 1 commit into from Aug 23, 2012

Conversation

brunomorency
Copy link
Contributor

Hi Tristan -- Here's a commit that adds an option to prefix date+time to all log messages. It's implemented through a logly.options() method that integrates both this 'date' option as well as the 'color' option added recently. To keep it backwards compatible, the logly.color() calls are still there but are just the same as logly.options({color: true}).

if(typeof colour === 'undefined') colour = noColour;

// add date as message prefix
var datePrefix = (options.datePrefix) ? (new Date()).toString() + ' ' : '';
Copy link
Owner

Choose a reason for hiding this comment

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

How do you feel about ISO8601via toISOString() ?

perhaps we can pass in a date format instead of just true? if the format is "ISO" or "ISO8601" it does it that way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like the idea of letting users just put a boolean value to get a default or a string to get their desired format.

@tristanls
Copy link
Owner

Thank you @brunomorency !

I'm happy to add it. I've added some inline comments for your consideration.

@brunomorency
Copy link
Contributor Author

Great, do you want me to make those changes or do you prefer putting it to your own tastes?

@tristanls
Copy link
Owner

I'll merge your stuff in and add what we agreed to. (I have to add to documentation, so might as well do it together).

tristanls added a commit that referenced this pull request Aug 23, 2012
Option to prefix date to messages
@tristanls tristanls merged commit 4e8e587 into tristanls:master Aug 23, 2012
@tristanls
Copy link
Owner

@brunomorency all updated, committed, and published. If you have a chance, please take a look if I messed something up. Cheers!

@brunomorency
Copy link
Contributor Author

Changes made post-merge seem good to me, thanks for quickly accepting that pull request!

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.

None yet

2 participants