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

Replace bunyan with pino #91

Merged
merged 19 commits into from May 12, 2020

Conversation

AleksandrSl
Copy link
Contributor

No description provided.

@ai ai changed the base branch from master to next May 11, 2020 20:26
@ai ai changed the base branch from next to master May 11, 2020 20:26
@ai ai changed the base branch from master to next May 11, 2020 20:27
human-formatter/index.js Outdated Show resolved Hide resolved
human-formatter/index.js Outdated Show resolved Hide resolved
human-formatter/index.js Outdated Show resolved Hide resolved
human-formatter/index.js Outdated Show resolved Hide resolved
human-formatter/index.js Outdated Show resolved Hide resolved
server/index.d.ts Show resolved Hide resolved
@AleksandrSl
Copy link
Contributor Author

Nice, flatMap seems to be not supported in node 10, my bad

@ai
Copy link
Member

ai commented May 11, 2020

Nice, flatMap seems to be not supported in node 10, my bad

What about array.map().flat()?

@AleksandrSl
Copy link
Contributor Author

From 11 version according to MDN

@ai
Copy link
Member

ai commented May 11, 2020

OK, let’s fix CI and I am ready to merge

This reverts commit b6fb451.
Though it looks complicated, it seems to be the best solution.
flatMap and flat are supported only from node 11.
@AleksandrSl
Copy link
Contributor Author

Added post-mortem about this case to commit message

@ai ai merged commit da7dc96 into logux:next May 12, 2020
@ai
Copy link
Member

ai commented May 12, 2020

Do you have an idea of how we can simplify logger options? Right now we have reporter and logger.

Maybe we should keep only logger: 'human' | 'json' | PinoLogger? I think Reporter API is too low level.

@AleksandrSl
Copy link
Contributor Author

AleksandrSl commented May 12, 2020

Maybe we should keep only logger: 'human' | 'json' | PinoLogger?

Sounds good, considering that reporter: 'human' | 'json' are ignored, if you pass custom logger.
Not sure that Reporter is low level, cause logger is wrapped in reporter and it's a single function, however it seems more complex to setup it in the right way/

What was the main point to have both reporter and logger? To allow customization of messages depending on their type?

@ai
Copy link
Member

ai commented May 12, 2020

What was the main point to have both reporter and logger?

Mostly historical.

Do you want to remove reporter from the public API? (We may need it for API between Server and BaseServer, but we can keep it as non-documented private API)

@AleksandrSl
Copy link
Contributor Author

Yeah, I will try to do this

ai added a commit that referenced this pull request May 27, 2020
* Replace bunyan with pino with smallest interference

* Replace PID in tests instead of stubbing it manually

* Use pino prettifier API for HumanFormatter

* Introduce hack to disable pino prettifier warning

Errors trigger flushSync in logger but it's not supported
 in combination with prettifier

* Increase test coverage

* Simplify reporter creation

* Remove useless TODO

* Fix formatting

* Clarify why I return undefined to suppress pino warning

* Remove useless comments

* Add eslint exception for human-formatter

* Fix merge error

* Add example of custom logger

* Enhance custom logger example

* Simplify custom logger example

Remove some options that have defaults.

* Fix complicated code in human-formatter

* Fix old typo in in human-formatter

* Revert "Fix complicated code in human-formatter"

This reverts commit b6fb451.
Though it looks complicated, it seems to be the best solution.
flatMap and flat are supported only from node 11.

Co-authored-by: Andrey Sitnik <andrey@sitnik.ru>
ai added a commit that referenced this pull request May 28, 2020
* Replace bunyan with pino with smallest interference

* Replace PID in tests instead of stubbing it manually

* Use pino prettifier API for HumanFormatter

* Introduce hack to disable pino prettifier warning

Errors trigger flushSync in logger but it's not supported
 in combination with prettifier

* Increase test coverage

* Simplify reporter creation

* Remove useless TODO

* Fix formatting

* Clarify why I return undefined to suppress pino warning

* Remove useless comments

* Add eslint exception for human-formatter

* Fix merge error

* Add example of custom logger

* Enhance custom logger example

* Simplify custom logger example

Remove some options that have defaults.

* Fix complicated code in human-formatter

* Fix old typo in in human-formatter

* Revert "Fix complicated code in human-formatter"

This reverts commit b6fb451.
Though it looks complicated, it seems to be the best solution.
flatMap and flat are supported only from node 11.

Co-authored-by: Andrey Sitnik <andrey@sitnik.ru>
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