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

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

youen
Copy link
Member

@youen youen commented Jun 14, 2021

$ 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
Copy link
Member

@adrienaury adrienaury left a comment

Choose a reason for hiding this comment

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

@@ -24,11 24,13 @@ import (
// MaskEngine is a masking algorithm
type MaskEngine interface {
Mask(Entry, ...Dictionary) (Entry, error)
Name() string
Copy link
Member 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()

Copy link
Member

@adrienaury adrienaury Jun 15, 2021

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
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.

None yet

2 participants