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

Logging #4

Open
josephbuchma opened this issue Dec 28, 2017 · 0 comments
Open

Logging #4

josephbuchma opened this issue Dec 28, 2017 · 0 comments

Comments

@josephbuchma
Copy link
Member

josephbuchma commented Dec 28, 2017

I see only 2 things that should be logged from user's point of view:

  • Migration progress (what version is currently being applied)
  • Errors

Latter can be logged by user (e.g. journey CLI), as errors are returned immediately.
Adding logging interface only to log migration progress seems like overkill.

In #3 I implemented ability to add pre/post migration hooks. Hook has following signature:

func(f file.File) error

So you can add "pre" hook like this:

func logMigrationHook(f file.File) error {
    examplelogger.Infof("Applying version %d", f.Version)
    return nil
}

(see PR for details on hooks api)

That pretty much solves the issue without extra bloating.

Except, maybe, debugging. Debug log is not something user would like to face, so we can simply bake any logger in, and make option to enable it.

Your thoughts ?

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

No branches or pull requests

1 participant