mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Merge remote-tracking branch 'origin/topic/dnthayer/ticket1616'
I changed the patch slightly - now debug.log is only created, if a debug stream is enabled. BIT-1616 #merged * origin/topic/dnthayer/ticket1616: Don't create debug.log immediately upon startup
This commit is contained in:
commit
b2371752e4
5 changed files with 25 additions and 12 deletions
5
CHANGES
5
CHANGES
|
@ -1,4 +1,9 @@
|
|||
|
||||
2.4-596 | 2016-06-07 11:07:29 -0700
|
||||
|
||||
* Don't create debug.log immediately upon startup (BIT-1616).
|
||||
(Daniel Thayer)
|
||||
|
||||
2.4-594 | 2016-06-06 18:11:16 -0700
|
||||
|
||||
* ASCII Input: Accept DOS/Windows newlines. Addresses BIT-1198
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
2.4-594
|
||||
2.4-596
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "Net.h"
|
||||
#include "plugin/Plugin.h"
|
||||
|
||||
DebugLogger debug_logger("debug");
|
||||
DebugLogger debug_logger;
|
||||
|
||||
// Same order here as in DebugStream.
|
||||
DebugLogger::Stream DebugLogger::streams[NUM_DBGS] = {
|
||||
|
@ -22,7 +22,18 @@ DebugLogger::Stream DebugLogger::streams[NUM_DBGS] = {
|
|||
{ "pktio", 0, false }, { "broker", 0, false }
|
||||
};
|
||||
|
||||
DebugLogger::DebugLogger(const char* filename)
|
||||
DebugLogger::DebugLogger()
|
||||
{
|
||||
verbose = false;
|
||||
}
|
||||
|
||||
DebugLogger::~DebugLogger()
|
||||
{
|
||||
if ( file && file != stderr )
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
void DebugLogger::OpenDebugLog(const char* filename)
|
||||
{
|
||||
if ( filename )
|
||||
{
|
||||
|
@ -45,14 +56,6 @@ DebugLogger::DebugLogger(const char* filename)
|
|||
}
|
||||
else
|
||||
file = stderr;
|
||||
|
||||
verbose = false;
|
||||
}
|
||||
|
||||
DebugLogger::~DebugLogger()
|
||||
{
|
||||
if ( file != stderr )
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
void DebugLogger::ShowStreamsHelp()
|
||||
|
|
|
@ -53,9 +53,11 @@ namespace plugin { class Plugin; }
|
|||
class DebugLogger {
|
||||
public:
|
||||
// Output goes to stderr per default.
|
||||
DebugLogger(const char* filename = 0);
|
||||
DebugLogger();
|
||||
~DebugLogger();
|
||||
|
||||
void OpenDebugLog(const char* filename = 0);
|
||||
|
||||
void Log(DebugStream stream, const char* fmt, ...);
|
||||
void Log(const plugin::Plugin& plugin, const char* fmt, ...);
|
||||
|
||||
|
|
|
@ -754,7 +754,10 @@ int main(int argc, char** argv)
|
|||
|
||||
#ifdef DEBUG
|
||||
if ( debug_streams )
|
||||
{
|
||||
debug_logger.EnableStreams(debug_streams);
|
||||
debug_logger.OpenDebugLog("debug");
|
||||
}
|
||||
#endif
|
||||
|
||||
init_random_seed(seed, (seed_load_file && *seed_load_file ? seed_load_file : 0) , seed_save_file);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue