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

Logger header #2627

Merged
merged 4 commits into from Jun 18, 2019

Conversation

@terry-xiaoyu
Copy link
Contributor

terry-xiaoyu commented Jun 15, 2019

Improve the ?LOG macro by supporting a module level log message header.

The logger header is provided by the module attribute logger_header, and its value must be a string (list).

If no logger header provided, no extra info will be prefixed to the log message.

e.g.

-include("logger.hrl").
-logger_header("[EMQ]").

?LOG(info, "Hi there!").

will give the following outputs:

[EMQ] Hi there!
@coveralls

This comment has been minimized.

Copy link

coveralls commented Jun 15, 2019

Pull Request Test Coverage Report for Build 5829

  • 43 of 199 (21.61%) changed or added relevant lines in 37 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.2%) to 68.756%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/emqx_alarm_handler.erl 2 3 66.67%
src/emqx_bridge_sup.erl 0 1 0.0%
src/emqx_mod_acl_internal.erl 0 1 0.0%
src/emqx_mountpoint.erl 0 1 0.0%
src/emqx_os_mon.erl 0 1 0.0%
src/emqx_protocol.erl 9 10 90.0%
src/emqx_mod_presence.erl 0 2 0.0%
src/emqx_psk.erl 0 2 0.0%
src/emqx_banned.erl 0 3 0.0%
src/emqx_broker_helper.erl 0 3 0.0%
Files with Coverage Reduction New Missed Lines %
src/emqx_alarm_handler.erl 1 75.56%
src/emqx_session.erl 3 69.3%
Totals Coverage Status
Change from base Build 5820: -0.2%
Covered Lines: 3543
Relevant Lines: 5153

💛 - Coveralls
@gilbertwong96

This comment has been minimized.

Copy link
Contributor

gilbertwong96 commented Jun 15, 2019

Good job!

@emqplus emqplus merged commit ebeb2c5 into develop Jun 18, 2019
3 checks passed
3 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls First build on logger_header at 68.834%
Details
@turtleDeng turtleDeng deleted the logger_header branch Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.