Skip to content

feat(log): move processing info log to debug level, add builder log#43

Draft
youen wants to merge 2 commits into
mainfrom
feat-debug-log
Draft

feat(log): move processing info log to debug level, add builder log#43
youen wants to merge 2 commits into
mainfrom
feat-debug-log

Conversation

@youen

@youen youen commented Jun 14, 2021

Copy link
Copy Markdown
Collaborator
$ pimo -v 3                                                                          
9:21PM INF Logger level set to info
9:21PM INF Start PIMO config=masking.yml dump-cache={} empty-input=false load-cache={} repeat=1 skipFieldOnError=false skipLineOnError=false
9:21PM INF Add mask config=masking.yml context=stdin mask="regex 0[1-7]( ([0-9])([0-9]))( ([0-9])([0-9]))( ([0-9])([0-9]))( ([0-9])([0-9]))" path=customer.phone
9:21PM INF Add mask config=masking.yml context=stdin mask="constant Bill" path=name
9:21PM INF Add mask config=masking.yml context=stdin mask="hash size=3" path=name2
9:21PM INF Add mask config=masking.yml context=stdin mask="randomInt min=25 max=32" path=age
9:21PM INF Add mask config=masking.yml context=stdin mask="command echo Dorothy" path=name3
9:21PM INF Add mask config=masking.yml context=stdin mask="weightedChoice size=2" path=surname
9:21PM INF Add mask config=masking.yml context=stdin mask="hash size=3" path=address.town
9:21PM INF Add mask config=masking.yml context=stdin mask="randDate dateMin=1970-01-01 00:00:00 +0000 UTC dateMax=2020-01-01 00:00:00 +0000 UTC" path=date
9:21PM INF Add mask config=masking.yml context=stdin mask="replacement name" path=name4
9:21PM INF Add mask config=masking.yml context=stdin mask="template {{.surname}}.{{.name}}@gmail.com" path=mail
9:21PM INF Add mask config=masking.yml context=stdin mask="duration -1440h0m0s" path=last_contact
{}
9:21PM WRN Path not found config=masking.yml context=stdin[1] input-line=1 output-line=1 path=customer.phone
9:21PM WRN Path not found config=masking.yml context=stdin[1] input-line=1 output-line=1 path=name
9:21PM WRN Path not found config=masking.yml context=stdin[1] input-line=1 output-line=1 path=name2
9:21PM WRN Path not found config=masking.yml context=stdin[1] input-line=1 output-line=1 path=age
9:21PM WRN Path not found config=masking.yml context=stdin[1] input-line=1 output-line=1 path=name3
9:21PM WRN Path not found config=masking.yml context=stdin[1] input-line=1 output-line=1 path=surname
9:21PM WRN Path not found config=masking.yml context=stdin[1] input-line=1 output-line=1 path=address.town
9:21PM WRN Path not found config=masking.yml context=stdin[1] input-line=1 output-line=1 path=date
9:21PM WRN Path not found config=masking.yml context=stdin[1] input-line=1 output-line=1 path=name4
9:21PM WRN Path not found config=masking.yml context=stdin[1] input-line=1 output-line=1 path=mail
9:21PM WRN Path not found config=masking.yml context=stdin[1] input-line=1 output-line=1 path=last_contact
{}
9:21PM INF End PIMO config=masking.yml duration=7.3721973s input-line=1 output-line=2 return=0 stats={"ignoredPaths":11,"skippedFields":0,"skippedLines":0}

@youen youen marked this pull request as draft June 14, 2021 21:23
@youen youen requested a review from adrienaury June 14, 2021 21:23

@adrienaury adrienaury left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment thread pkg/model/model.go Outdated
// MaskEngine is a masking algorithm
type MaskEngine interface {
Mask(Entry, ...Dictionary) (Entry, error)
Name() string

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Maybe Name is not the good name... String()

@adrienaury adrienaury Jun 15, 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, signature String() string if you want to implement the fmt.Stringer interface (and then get compatibility with all method from fmt package)

Be careful to not use fmt.Printf("%v", mask) inside String() string because you will have an infinite loop

@adrienaury

Copy link
Copy Markdown
Member

Maybe instead of

9:14PM INF Add mask config=masking.yml context=stdin mask="constant Benjamin" path=name

use

9:14PM INF Configure mask config=masking.yml context=stdin mask="constant Benjamin" path=name

Because there is a mask named Add and it can be confusing ?

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.

2 participants