Closed Bug 6322 Opened 25 years ago Closed 25 years ago

PR_LOG messages aren't printed: logFile == NULL

Categories

(NSPR :: NSPR, defect, P3)

x86
FreeBSD
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: lennox, Assigned: larryh)

Details

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.)
Status: NEW → ASSIGNED
Accepted the bug and cc list.
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() */
Assignee: srinivas → larryh
Status: ASSIGNED → NEW
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.