Re: Print object name and method name in log statements

Dmitry Matveev <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.gnu.general
Message-ID <CAOW=R8kQAyZQjrdTh-KR6yFu-kQdWW=hsdxADHRJ=-aujj50Ww@mail.gmail.com>
Hi Stephen,

I am not sure about the line number, but you can always use "self class
name" and something of thisContext (i.e. "thisContext printString") to get
the stack frame details.
If your objects have special (personal) names, it is up to you to implement
the appropriate accessor methods (or a protocol).

With best regards,
Dmitry

2015-02-04 4:06 GMT+03:00 Stephen Woolerton <[email protected]>:

> Hi,
>
> Is there a way to access the name of the current Object, and name of the
> current method, when a program is running? And if so, is line number
> accessible too?
>
> I would like this information for logging statements, as a prefix to the
> log text.
>
> Thanks
> Stephen
>
>
>
> _______________________________________________
> help-smalltalk mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/help-smalltalk
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.