mirror of
https://github.com/gigablast/open-source-search-engine.git
synced 2024-10-04 04:07:13 +03:00
logging fixes
This commit is contained in:
parent
f293045ace
commit
36e26436b5
7
Log.cpp
7
Log.cpp
@ -31,6 +31,10 @@ long g_dbufSize = 0;
|
||||
// main process id
|
||||
static pid_t s_pid = -1;
|
||||
|
||||
void Log::setPid ( ) {
|
||||
s_pid = getpidtid();
|
||||
}
|
||||
|
||||
Log::Log () {
|
||||
m_fd = -1;
|
||||
m_filename = NULL;
|
||||
@ -55,7 +59,8 @@ void Log::reset ( ) {
|
||||
|
||||
bool Log::init ( char *filename ) {
|
||||
// set the main process id
|
||||
s_pid = getpidtid();
|
||||
//s_pid = getpidtid();
|
||||
setPid();
|
||||
// init these
|
||||
m_numErrors = 0;
|
||||
m_bufPtr = 0;
|
||||
|
2
Log.h
2
Log.h
@ -124,6 +124,8 @@ class Log {
|
||||
|
||||
void reset ( );
|
||||
|
||||
void setPid();
|
||||
|
||||
// save before exiting
|
||||
void close () { dumpLog(); };
|
||||
|
||||
|
25
Threads.cpp
25
Threads.cpp
@ -178,17 +178,7 @@ Threads::Threads ( ) {
|
||||
m_initialized = false;
|
||||
}
|
||||
|
||||
bool Threads::init ( ) {
|
||||
|
||||
if ( m_initialized ) return true;
|
||||
m_initialized = true;
|
||||
|
||||
m_needsCleanup = false;
|
||||
//m_needBottom = false;
|
||||
|
||||
// sanity check
|
||||
if ( sizeof(pthread_t) > sizeof(pid_t) ) { char *xx=NULL;*xx=0; }
|
||||
|
||||
void Threads::setPid ( ) {
|
||||
// set s_pid to the main process id
|
||||
#ifdef PTHREADS
|
||||
s_pid = pthread_self();
|
||||
@ -207,7 +197,20 @@ bool Threads::init ( ) {
|
||||
#else
|
||||
s_pid = getpid();
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Threads::init ( ) {
|
||||
|
||||
if ( m_initialized ) return true;
|
||||
m_initialized = true;
|
||||
|
||||
m_needsCleanup = false;
|
||||
//m_needBottom = false;
|
||||
|
||||
// sanity check
|
||||
if ( sizeof(pthread_t) > sizeof(pid_t) ) { char *xx=NULL;*xx=0; }
|
||||
|
||||
setPid();
|
||||
|
||||
#ifdef _STACK_GROWS_UP
|
||||
return log("thread: Stack growing up not supported.");
|
||||
|
@ -172,6 +172,7 @@ class Threads {
|
||||
|
||||
long getStack ( ) ;
|
||||
void returnStack ( long si );
|
||||
void setPid();
|
||||
void reset ( ) ;
|
||||
|
||||
// . we restrict the # of threads based on their type
|
||||
|
@ -63,7 +63,7 @@ A work-in-progress <a href=/compare.html>comparison to SOLR</a>.
|
||||
<br><br><a name=quickstart></a>
|
||||
<h1>Quick Start</h1>
|
||||
|
||||
Until I get the binary packages ready, <a href=#src>build from the source code</a>, it's easy.
|
||||
Until I get the binary packages ready, <a href=#src>build from the source code</a>, it should only take about 30 seconds to type the three commands.
|
||||
<!--
|
||||
Requirements: You will need an Intel or AMD system running Linux and at least 4GB of RAM.<br><br>
|
||||
|
||||
@ -100,7 +100,7 @@ You will need the following packages installed<br>
|
||||
|
||||
<b>1.</b> Do <b>apt-get install make g++ gcc-multilib lib32stdc++6</b>
|
||||
<br>
|
||||
<b>2.</b> Download the <a href=https://github.com/gigablast/open-source-search-engine/archive/master.zip>Gigablast source code</a>, unzip it and cd into it. Alternatively, clone it from <a href=https://github.com/gigablast/open-source-search-engine>Gigablast on Github</a>.
|
||||
<b>2.</b> Download the <a href=https://github.com/gigablast/open-source-search-engine>Gigablast source code</a> using <b>wget --no-check-certificate "https://github.com/gigablast/open-source-search-engine/archive/master.zip"</b>, unzip it and cd into it.
|
||||
<br>
|
||||
<b>3.</b> Run <b>make</b> to compile. (e.g. use 'make -j 4' to compile on four cores)
|
||||
<br>
|
||||
|
Loading…
Reference in New Issue
Block a user