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

Change the mechanism for adding new line character (i.e. '\n\) to log messages in some loggers. #308

Closed
mskoleck opened this issue Jul 10, 2014 · 2 comments
Milestone

Comments

@mskoleck
Copy link
Contributor

Currently both in DDFileLogger and DDTTYLogger the '\n' character is added to each outputted string if the output does not end with the newline. This means that some custom formattings which would like to output multiple log messages in the same line are not possible.

Would it be possible to change both of those loggers not to add the newline character in case when the custom formatter is used. Then developers could provide their own formatters that would allow more control over the messages. Standard formatting would still add the newline character in the default case.

In case of DDFileLogger it just requires moving the line appending code from the log message to the default formatter. In case of DDTTYLogger it requires not adding the 5th element of the iovec struct array.

In case of ASL logger, the format is controlled by the asl api so no change is needed there.

@rivera-ernesto
Copy link
Member

Maybe a addNewLineToLogMessagesIfNeeded flag (default YES) would be handy.

Pull request? ;)

mskoleck pushed a commit to mskoleck/CocoaLumberjack that referenced this issue Jul 15, 2014
…matically when using a custom log formatter
mskoleck pushed a commit to mskoleck/CocoaLumberjack that referenced this issue Jul 18, 2014
…try to make the '\n' appending logic in the file logger more clear and performant
mskoleck pushed a commit to mskoleck/CocoaLumberjack that referenced this issue Jul 30, 2014
rivera-ernesto pushed a commit that referenced this issue Jul 31, 2014
@bpoplauschi bpoplauschi added this to the 1.9.2 milestone Aug 11, 2014
@bpoplauschi
Copy link
Member

Fixed by #310

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

No branches or pull requests

3 participants