Skip to content

Conversation

@ehanson8
Copy link
Contributor

What does this PR do?

Adding structlog. For some reason, I had to add the config code block (lines 23-32) to get the desired output even though I didn't need to add that code block to my ArchivesSpace code. I did a lot of testing/comparison to no avail to but I may be adding a similar code block to the ArchivesSpace code in case there is some weird local thing that is triggering the structlog config in the ArchivesSpace repo.

Includes new or updated dependencies?

YES

Copy link
Contributor

@hakbailey hakbailey left a comment

Choose a reason for hiding this comment

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

Some comments about what did and didn't work for me when I tried to run this. @gravesm will probably have a better explanation for why those things happened...

def main(ctx, url, email, password):
ctx.obj = {}
print('Application start')
structlog.configure(processors=[
Copy link
Contributor

Choose a reason for hiding this comment

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

I was able to remove this entire block and it logged fine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you getting 2019-11-26 13:39.16 Application start or {"event": "Application start", "logger": "__main__", "level": "info", "timestamp": "2019-11-26T18:40:30.819933Z"}? I just commented it out again and I'm still having the same problem where it gives me unstructured log entries in the terminal but nothing to the file

@gravesm
Copy link

gravesm commented Nov 26, 2019

I would hold off on adding the config block. I am indeed seeing the unstructured message without it, but based on my understanding of structlog that seems wrong. We should take the time to understand what's going on before adding code just to make it work.

@ehanson8
Copy link
Contributor Author

OK, I'll pull it back

@ehanson8
Copy link
Contributor Author

And for the record, this is where I found the code that I'm adapting https://structlog.readthedocs.io/en/16.1.0/standard-library.html#suggested-configuration

@ehanson8 ehanson8 force-pushed the add-structlog branch 2 times, most recently from b08c87b to 88ab8dd Compare November 26, 2019 19:58
@ehanson8
Copy link
Contributor Author

Updated

@ehanson8 ehanson8 merged commit 1ba35eb into refactor Dec 5, 2019
@ehanson8 ehanson8 deleted the add-structlog branch December 5, 2019 18:46
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.

4 participants