Thanks to all for the replies... I wasn't getting any output because
of some unrelated linking errors. After fixing them, debugging is
working as expected :)

On Fri, Jun 1, 2012 at 2:46 AM, Sergey Polischuk <[email protected]> wrote:
> Hi
>
> You can set your own notify handler like this to check if you ever get 
> messages from osg:
>
> class NH : public osg::NotifyHandler
> {
> public:
>        NH()
>                : m_out("osg_log.txt")
>        {
>        }
>        ~NH()
>        {
>                m_out.close();
>        }
>        void notify (osg::NotifySeverity severity, const char *message)
>        {
>                m_out << message;
>        }
> private:
>        std::ofstream m_out;
> };
>
> osg::setNotifyHandler(new NH);
>
> Cheers,
> Sergey.
>
> 31.05.2012, 22:25, "Preet" <[email protected]>:
>> Hi Robert,
>>
>> That's what I'm currently doing (ie using stack traces to try and
>> figure stuff out), but I was wondering why osg doesn't give me *any*
>> output at all. For instance, I'm apparently able to do a bunch of
>> stuff: Load an *.osg model, setup an animation path, create nodes,
>> etc, pretty much all of the scene setup goes fine up until I try to
>> create the viewer. Doesn't doing any of those things before the viewer
>> provide output when I've set the notify level to debug? I made sure I
>> compiled with OSG_DISABLE_NOTIFY (or whatever the exact wording for
>> that flag was) to allow notifications.
>>
>> On Thu, May 31, 2012 at 4:57 AM, Robert Osfield
>> <[email protected]> wrote:
>>
>>>  Hi Preet,
>>>
>>>  The osg::notify system isn't related to handling of std exceptions
>>>  except where some specific code might catch an exception and report
>>>  the output to osg::notify.  This means that upping the notify level
>>>  won't effect how exceptions are handled.
>>>
>>>  The best thing to do is run a debugger and the look at the stack trace
>>>  where the application crashes.
>>>
>>>  Robert.
>>>
>>>  On 31 May 2012 07:57, Preet <[email protected]> wrote:
>>>>  Hiya,
>>>>
>>>>  I'm trying to debug a std::bad_alloc() exception from osg that doesn't
>>>>  product any other output. I can't set environment variables, so I
>>>>  tried:
>>>>  osg::setNotifyLevel(osg::DEBUG_INFO);
>>>>
>>>>  This still doesn't give me any output. The system I'm on dumps stdout
>>>>  and stderr to a log file in a specific directory and since Notify.cpp
>>>>  dumps to both of those it seems like I should be seeing something, but
>>>>  I'm not. However, I do get statements like "std::cout << "Hello" <<
>>>>  std::endl" outputted as expected when used in my application (just not
>>>>  from osg). Am I missing something obvious?
>>>>
>>>>  Preet
>>>>  _______________________________________________
>>>>  osg-users mailing list
>>>>  [email protected]
>>>>  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>>  _______________________________________________
>>>  osg-users mailing list
>>>  [email protected]
>>>  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>> _______________________________________________
>> osg-users mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to