Added parallel logging to STDOUT while in non-daemon mode

This commit is contained in:
kapyar 2003-10-02 20:03:55 +00:00
parent 0999dbae05
commit 2a83a72816
4 changed files with 26 additions and 11 deletions

View File

@ -40,7 +40,7 @@ if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
# LD="/usr/libexec/elf/ld" LDFLAGS="" LIBS="" \
# NM="/usr/bin/nm -B" RANLIB="ranlib" LN_S="ln -s" \
# DLLTOOL="" OBJDUMP="" AS="" \
# ./ltconfig --cache-file=./config.cache --with-gcc --with-gnu-ld --no-verify ./ltmain.sh i386-unknown-freebsdelf4.8
# ./ltconfig --cache-file=./config.cache --with-gcc --with-gnu-ld --no-verify ./ltmain.sh i386-unknown-freebsdelf4.9
#
# Compiler and other test output produced by ltconfig, useful for
# debugging ltconfig, is in ./config.log if it exists.
@ -70,8 +70,8 @@ build_old_libs=yes
fast_install=yes
# The host system.
host_alias=i386-unknown-freebsdelf4.8
host=i386-unknown-freebsdelf4.8
host_alias=i386-unknown-freebsdelf4.9
host=i386-unknown-freebsdelf4.9
# An echo program that does not interpret backslashes.
echo="echo"

View File

@ -6,11 +6,14 @@ RunInTerminal=true
ShowLocals=true
[filenumbers]
0=143
0=1
1=143
2=1
3=217
2=143
3=1
4=1
5=50
6=98
7=39
[filemarkers]
0=
@ -18,11 +21,19 @@ ShowLocals=true
2=
3=
4=
5=
6=
7=
[filelist]
0=/usr/home/avm/work/mbus/src/sock.c
0=/usr/home/avm/work/mbus/src/globals.h
1=/usr/home/avm/work/mbus/src/tty.c
2=/usr/home/avm/work/mbus/src/globals.h
2=/usr/home/avm/work/mbus/src/sock.c
3=/usr/home/avm/work/mbus/src/cfg.h
4=/usr/home/avm/work/mbus/src/cfg.c
5=/usr/home/avm/work/mbus/src/main.c
6=/usr/home/avm/work/mbus/src/log.c
7=/usr/home/avm/work/mbus/src/log.h
[find_text]
0=TIOS

View File

@ -28,7 +28,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: log.c,v 1.1 2003/09/13 20:38:16 kapyar Exp $
* $Id: log.c,v 1.2 2003/10/02 20:03:55 kapyar Exp $
*/
#include "log.h"
@ -93,7 +93,7 @@ log(int level, char *fmt, ...)
int strsize = 0;
static char str[INTBUFSIZE + 1] = {0}, *p;
if (*logfullname == '\0' || level > cfg.dbglvl) return;
if (level > cfg.dbglvl) return;
#ifdef HRDATE
tt = time(NULL);
t = localtime(&tt);
@ -107,6 +107,8 @@ log(int level, char *fmt, ...)
strsize += vsnprintf(p, INTBUFSIZE - strsize, fmt, args);
va_end(args);
strcpy(str + strsize++, "\n");
if (!isdaemon) printf("%s", str);
if (*logfullname == '\0') return;
log_app(logfullname, str);
}
#endif

View File

@ -28,7 +28,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: log.h,v 1.1 2003/09/13 20:38:16 kapyar Exp $
* $Id: log.h,v 1.2 2003/10/02 20:03:55 kapyar Exp $
*/
#ifndef _LOG_H
@ -36,6 +36,8 @@
#include "globals.h"
extern int isdaemon;
/* Default log file path and name */
#define LOGPATH "/var/log/"
#define LOGNAME "mbus.log"