Skip to content

Commit

Permalink
Merge pull request #62 from kafka4beam/feat-snk-prod-ind
Browse files Browse the repository at this point in the history
feat: SNK_PROD_KIND
  • Loading branch information
ieQu1 authored May 3, 2023
2 parents 732ac2c + 9ebc096 commit 6905894
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.0.9
### Features
- Now it is possible to redefine what `?snk_kind` macro translates to in prod mode by defining `SNK_PROD_KIND` macro.

## 1.0.8
### Features
- Add a new `?tp_ignore_side_effects_in_prod` macro for the cases where side effects of the trace event are _expected_ to be lost in prod.

## 1.0.7
### Non-BC changes
- Change the format of `$trace_begin` event from `#{?snk_kind => '$trace_begin', ts => ...}` to `#{?snk_kind => '$trace_begin', ?snk_meta => #{time => ...}}`
Expand Down
6 changes: 5 additions & 1 deletion include/trace_prod.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@

-include("common.hrl").

-ifndef(SNK_PROD_KIND).
-define(SNK_PROD_KIND, ?snk_kind).
-endif.

-define(tp(LEVEL, KIND, EVT),
logger:log(LEVEL,
EVT#{ ?snk_kind => KIND },
EVT#{ ?SNK_PROD_KIND => KIND },
#{ mfa => {?MODULE, ?FUNCTION_NAME, ?FUNCTION_ARITY}
, line => ?LINE
, file => ?FILE
Expand Down

0 comments on commit 6905894

Please sign in to comment.