This commit is contained in:
warren%netscape.com 1998-09-01 00:17:18 +00:00
Родитель f4feae04b9
Коммит 2fa483e8ba
2 изменённых файлов: 27 добавлений и 1 удалений

Просмотреть файл

@ -140,6 +140,11 @@ typedef struct PRLogModuleInfo {
*/
PR_EXTERN(PRLogModuleInfo*) PR_NewLogModule(const char *name);
/*
** Destroys a log module.
*/
PR_EXTERN(void) PR_DestroyLogModule(PRLogModuleInfo* logModule);
/*
** Set the file to use for logging. Returns PR_FALSE if the file cannot
** be created

Просмотреть файл

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
@ -310,6 +310,27 @@ PR_IMPLEMENT(PRLogModuleInfo*) PR_NewLogModule(const char *name)
return lm;
}
PR_IMPLEMENT(void) PR_DestroyLogModule(PRLogModuleInfo* lm)
{
PR_LogFlush();
/* unlink this log module from the list */
if (lm == logModules) {
logModules = logModules->next;
}
else {
PRLogModuleInfo* chain = logModules;
while (chain && chain->next != lm)
chain = chain->next;
PR_ASSERT(chain && chain->next);
chain->next = chain->next->next;
}
/* and free it */
free((void*)lm->name);
PR_Free(lm);
}
PR_IMPLEMENT(PRBool) PR_SetLogFile(const char *file)
{
#ifdef PR_LOGGING