473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to find what called a function

I am making a logger class in my application, i want to put a display
the source which called the logging method. How can i do this?

say if i call Logger->debug("Test Message") then the Logger can
display DEBUG:SOURCE of CALL:Test Message

Aug 25 '08 #1
1 1332
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

bibstha <bi***********@gmail.com>
on Sunday 24 August 2008 21:55
wrote in comp.lang.php:

I am making a logger class in my application, i want to put a display
the source which called the logging method. How can i do this?

say if i call Logger->debug("Test Message") then the Logger can
display DEBUG:SOURCE of CALL:Test Message
Try the debug_backtrace() or debug_print_backtrace() functions,
read the documentation of both at:
http://www.php.net/manual/en/functio...-backtrace.php

This would help a bit...

Regards,
- --
.O. | Daniel Molina Wegener | C/C++ Developer
..O | dmw [at] coder [dot] cl | FOSS Coding Adict
OOO | http://coder.cl/ | Standards Rocks!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (FreeBSD)

iEYEARECAAYFAkiyK94ACgkQxyPEFPXO3WGJsQCfbYA1QMKCnm 8KT75PhQGVAyO1
EowAn0GpcmPf2LnzowoZb08tIYnW9U7P
=HmC0
-----END PGP SIGNATURE-----
Aug 25 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Saeed Amrollahi | last post by:
Dear All C++ Programmers Hello I am Saeed Amrollahi. I am a software engineer in Tehran Sewerage Company. I try to use std::map and map::find member function. I use Visual Studio .NET. my...
3
by: Mike Kamermans | last post by:
How do I find out from which tag I called a javascript function at runtime? I have a stack of nested custom tags, in the following structure: <tag_1 value="someval"> <tag_2>content</tag_2>...
1
by: Shawn McNiven | last post by:
Hello, I have a problem with an application i'm working on (Asp.net using vb.net for developing). I'm normally used to doing middle tier development, so my javascript skills are not up to par. ...
8
by: jquest | last post by:
Hi Again; I have had help from this group before and want to thank everyone, especially PCDatasheet. My database includes a field called HomePhone, it uses the (xxx)xxx-xxx format to include...
4
by: Ahmed S. Badran | last post by:
Hi, Is there a tool that would parse a C file and tell me the list of functions that are being called in the file. The C file includes header files for the functions being used. Also is there...
12
by: Rubbrecht Philippe | last post by:
Hi there, According to documentation I read the ArrayList.IndexOf method uses the Object.Equals method to loop through the items in its list and locate the first index of an item that returns...
6
by: bobueland | last post by:
The module string has a function called translate. I tried to find the source code for that function. In: C:\Python24\Lib there is one file called string.py I open it and it says
27
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
6
by: roland.bali | last post by:
Hi, Here is the basic setup, my base class is Shoe which has a child class called Sandal. I would like to create objects by calling Sandal.Load. But without overloading Load in Sandal and...
8
by: Frank Rizzo | last post by:
Is there a setting in VS2005 to quickly locate methods that are unused (maybe through compiler warnings)? If not, any utilities out there that do that? Thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.