PR_LOG messages aren't printed: logFile == NULL

RESOLVED WORKSFORME

Status

NSPR
NSPR
P3
normal
RESOLVED WORKSFORME
19 years ago
19 years ago

People

(Reporter: Jonathan Lennox, Assigned: larryh (gone))

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

19 years ago
I can't get PR_LOG log messages to print in SeaMonkey.  I set the environment
variables as described in prlog.h, but I still don't (normally) see any output.

I also notice the following phenomenon: if, in gdb, I do a "break main" before
running apprunner, I notice at the time main runs that _pr_initialized is 1, but
logFile is NULL.  Tracing through things, this is why no log information gets
printed; PR_LogPrint automatically returns without doing anything if logFile is
NULL.  This behavior happens whether NSPR_LOG_FILE is set or not.
NSPR_LOG_MODULES is set to 'nsComponentManager:5'.

If I manually do 'set logFile = _pr_stderr' in gdb after 'break main', I see all
the PR_LOG messages I expect.

(I'm not sure I have the NSPR version number right; it's the one you get when
you pull SeaMonkeyAll from CVS.  I'm building NSPR in the SeaMonkey tree.)

Updated

19 years ago
Status: NEW → ASSIGNED

Comment 1

19 years ago
Accepted the bug and cc list.
(Assignee)

Comment 2

19 years ago
See the following code fragment for technique in using PR_LOG().

static void UserLogStuff( void )
{
    PRLogModuleInfo *myLM;
    PRIntn i;

    myLM = PR_NewLogModule( "userStuff" );
    if (! myLM )
      {
        printf("UserLogStuff(): can't create new log module\n" );
        return;
      }

    PR_LOG( myLM, PR_LOG_NOTICE, ("Log a Notice %d\n", 1 ));

    for (i = 0; i < 10 ; i++ )
      {
        PR_LOG( myLM, PR_LOG_DEBUG, ("Log Debug number: %d\n", i));
        PR_Sleep( 300 );
      }
} /* end UserLogStuff() */

Updated

19 years ago
Assignee: srinivas → larryh
Status: ASSIGNED → NEW
(Assignee)

Updated

19 years ago
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.