Skip to content

Commit

Permalink
fix level control issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kala13x committed Apr 18, 2015
1 parent e89165c commit 20bbd58
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
CXXFLAGS = -Wall -g
CFLAGS = -g -O2 -Wall
OBJ = slog.o

example: example.c $(OBJ)
gcc $(CXXFLAGS) -o example example.c $(OBJ)
gcc $(CFLAGS) -o example example.c $(OBJ)

slog.o: slog.h

Expand Down
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified example-2015-04-02.log
100644 → 100755
Empty file.
Empty file modified example.c
100644 → 100755
Empty file.
Empty file modified license.txt
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions slog.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void init_date(SystemDate *mdate)
const char* slog_version()
{
static char verstr[128];
sprintf(verstr, "%s Build %d", SLOGVERSION, SLOGBUILD);
sprintf(verstr, "%s Build %d (%s)", SLOGVERSION, SLOGBUILD, __DATE__);
return verstr;
}

Expand Down Expand Up @@ -160,7 +160,7 @@ void slog(int level, char *msg, ...)
va_end(args);

/* Check logging levels */
if(!level || level <= slog_val.level && level <= slog_val.l_max)
if((!level || level <= slog_val.level) && level <= slog_val.l_max)
{
/* Generate output string with date */
sprintf(output, "%02d.%02d.%02d-%02d:%02d:%02d - %s\n",
Expand All @@ -173,4 +173,4 @@ void slog(int level, char *msg, ...)
if (slog_val.to_file)
log_to_file(output, slog_val.fname, &mdate);
}
}
}
Empty file modified slog.cfg
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions slog.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern "C" {
#include <stdarg.h>

/* Definations for version info */
#define SLOGVERSION "0.2.1 Snapshot"
#define SLOGVERSION "0.2.2 Snapshot"
#define SLOGBUILD 14


Expand Down Expand Up @@ -81,4 +81,4 @@ void slog(int level, char *msg, ...);
---------------------------------------------*/
#ifdef __cplusplus
}
#endif
#endif

0 comments on commit 20bbd58

Please sign in to comment.