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

Question: how to wrap seelog in own package? #36

Merged
merged 1 commit into from Sep 9, 2013
Merged

Conversation

goodsign
Copy link
Collaborator

@goodsign goodsign commented Sep 9, 2013

Hi there,

I want to use seelog in a mixed hosting environment: appengine and standalone.

Since appengine has its own logging mechanism - attached to the Context interface - I want to have a custom log package that abstracts this away.

But when I create a struct and call the Info method which delegates to seelog, I see this

[2013-09-05 23:50:33] [INFO] [101loops/log.(*Logger).Info] ...

instead of

[2013-09-05 23:50:33] [INFO] [101loops/module.start] ...

How can I make seelog log the correct location when being wrapped?

@goodsign
Copy link
Collaborator

goodsign commented Sep 6, 2013

Hi!

Could you please provide a small gist illustrating how you wrap seelog.

@stephanos
Copy link
Author

@goodsign
Copy link
Collaborator

goodsign commented Sep 7, 2013

I see, so (*Logger).Info is actually the location where you call seelog.Info. And you want to be able to set custom stack depth where seelog gets 'current' function name. In your case you want to increase it by one.

It's possible to add this feature, let me think a bit about the implementation.

Thanks for suggestion!

@stephanos
Copy link
Author

Exactly!

@goodsign
Copy link
Collaborator

goodsign commented Sep 9, 2013

Hi stephanos,

Please take a look at the feature implementation in commit c4b4bb1

You can even checkout the feature branch gs_issue_36 and test it in your environment to see if it fits well.

If we are on the same page and the implementation seems fine, then I'll proceed with merge and tagging.

@stephanos
Copy link
Author

Just tried it out, works fine :)

@goodsign
Copy link
Collaborator

goodsign commented Sep 9, 2013

Great! I'll merge it soon!

goodsign added a commit that referenced this pull request Sep 9, 2013
Question: how to wrap seelog in own package?
@goodsign goodsign merged commit e73093a into dev Sep 9, 2013
@goodsign goodsign deleted the gs_issue_36 branch September 9, 2013 10:52
@stephanos
Copy link
Author

Great, this is why I love open source! 👍

@goodsign
Copy link
Collaborator

goodsign commented Sep 9, 2013

I'll be back soon and merge it into master + create a new tag. Time for a minor release :)

@goodsign
Copy link
Collaborator

goodsign commented Sep 9, 2013

Done! Everything merged to master + added a tag 'v2.4'.

Thanks for the issue!

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