question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accessing full method name

See original GitHub issue

I need to access the fully fledged method name /[package].[service]/[method] in a middleware. That can be done either by adding a new property to Context or repurposing name property to contain the full name. What do you think, which one is the better approach?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
bojandcommented, Mar 9, 2017

Started thinking / working on this. Would this be good for context?

{ 
  type: 'unary', // unchanged, one of Mali Call types
  name: 'SayHello', // unchanged, the name of the call
  fullName: '/helloworld.Greeter/SayHello', // NEW - full name
  service: 'Greeter', // NEW - service name
  package: 'helloworld', // NEW - package name
  metadata: ..., // unchanged metadata object
  req: ..., // unchanged req object
  res: ..., // unchanged, res object if applicable, only in case of Duplex call
  call: ..., // unchanged, the internal call object
  app: ... // unchanged the app reference
}

Please provide feedback. Should have something in a few days.

1reaction
bojandcommented, Mar 11, 2017

Merged and published as 0.2.3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Getting the name of the currently executing method
Technically this will work... String name = new Object(){}.getClass().getEnclosingMethod().getName();. However, a new anonymous inner class ...
Read more >
How to Get a Name of a Method Being Executed? | Baeldung
This quick article presents a couple of simple ways of getting hold of the method name in the current execution stack.
Read more >
Get name of current method being executed in Java
Getting name of currently executing method is useful for handling exceptions and debugging purposes. Below are different methods to get ...
Read more >
Get Current Execution Method Name - JavaInUse
Many a times for logging purpose we require the name of current execution method. This can be achieved in following ways. Java.lang.Class.
Read more >
Function.prototype.name - JavaScript - MDN Web Docs
Anonymous function expressions created using the keyword function or arrow functions would have "" (an empty string) as their name.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found