omniti-labs / jlog Goto Github PK
View Code? Open in Web Editor NEWJLog - Journaled Log
License: BSD 3-Clause "New" or "Revised" License
JLog - Journaled Log
License: BSD 3-Clause "New" or "Revised" License
I tried to use the setup.py file in /python folder to build jlog.
it throws error:
#warning "16 bit int type not found."
^
jlog_config.h:125:2: error: #error "32 bit int type not found."
#error "32 bit int type not found."
^
jlog_config.h:141:2: error: #error "8 bit int type not found."
#error "8 bit int type not found."
^
jlog_config.h:149:2: warning: #warning "16 bit int type not found." [-Wcpp]
#warning "16 bit int type not found."
^
jlog_config.h:158:2: error: #error "32 bit int type not found."
#error "32 bit int type not found."
^
In file included from jlog.c:7008:0:
/usr/include/python2.7/longintrepr.h:43:2: error: #error "30-bit long digits requested, but the necessary types are not available on this platform"
#error "30-bit long digits requested, but the necessary types are not available on this platform"
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
So as you see, I am running on 64 bit Linux, does it a platform issue ?
Thanks !
@postwait
Is this repo still under maintainence ?
if the last segment didn't reach the maximum size (4.1M ), even it was consumed, this segment will not be deleted.
@postwait @omnitilabs
The function in jlog_file_size in jlog_io.c from jlog-1.2 has the following broken logic in it:
while ((rv = fstat(f->fd, &sb) != 0) == -1 && errno == EINTR) ;
Extracting this sub-expression:
(rv = fstat(f->fd, &sb) != 0) == -1
There are a couple of issues with this:
rv = (fstat(f->fd, &sb) != 0) == -1
That is probably not the author's original intention.
The net result is that the EINTR (interrupted syscall) handling is broken in jlog 1.2.
I developed a wrapper for Go. I use it to push jlog data to an http endpoint. The endpoint is part of our email delivery analytics solution. I am willing to contribute the wrapper to this project, or share it in a separate project. Let me know if you are open to receive a pull request for this.
Thanks for jlog! Can you guys please make this package available through pypi so it's easier to distribute?
There is a fix for an erroneous warning message that jlogctl
was emitting that hasn't been released yet (commit 05acd3e). Since that was done in 2020, please, do you think we can get a new release that would include the bug fix? Thanks!
Hey there!
I'm trying to get the jlog examples running from the Concepts Page and am getting JLOG_ERR_META_OPEN errors with both the reader and the writer. Here's the output from the running examples with jlog DEBUG turned on:
[vagrant@localhost jlog]$ rm -rf /var/log/jlogexample/*
[vagrant@localhost jlog]$ make
cc -I/home/vagrant/jlog -L/home/vagrant/jlog -ljlog writer.c -o writer
cc -I/home/vagrant/jlog -L/home/vagrant/jlog -ljlog reader.c -o reader
[vagrant@localhost jlog]$ ./writer
checkpoint one filename is /var/log/jlogexample/cp.6f6e65
checkpoint one filename is /var/log/jlogexample/cp.6f6e65
checkpoint two filename is /var/log/jlogexample/cp.74776f
checkpoint two filename is /var/log/jlogexample/cp.74776f
__jlog_open_metastore
__jlog_restore_metastore
jlog_ctx_open_writer_failed: 20 JLOG_ERR_META_OPEN
[vagrant@localhost jlog]$ ./reader
__jlog_open_metastore
checkpoint one filename is /var/log/jlogexample/cp.6f6e65
__jlog_restore_metastore
jlog_ctx_open_reader failed: 20 JLOG_ERR_META_OPEN
Any advice or other things I can try?
Thanks so much!
Blake
Here's the source of writer.c:
#include <stdio.h>
#include <string.h>
#include <jlog.h>
int main() {
jlog_ctx *ctx;
const char *path = "/var/log/jlogexample";
int rc;
ctx = jlog_new(path);
if (jlog_ctx_init(ctx) != 0) {
if (jlog_ctx_err(ctx) != JLOG_ERR_CREATE_EXISTS) {
fprintf(stderr, "jlog_ctx_init failed: %d %s\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx));
exit(1);
}
jlog_ctx_add_subscriber(ctx, "one", JLOG_BEGIN);
jlog_ctx_add_subscriber(ctx, "two", JLOG_BEGIN);
}
jlog_ctx_close(ctx);
ctx = jlog_new(path);
if (jlog_ctx_open_writer(ctx) != 0) {
fprintf(stderr, "jlog_ctx_open_writer_failed: %d %s\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx));
exit(0);
}
rc = jlog_ctx_write(ctx, "hello\n", strlen("hello\n"));
if (rc != 0) {
fprintf(stderr, "jlog_ctx_write_message failed: %d %s\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx));
}
jlog_ctx_close(ctx);
}
And reader.c:
#include <stdio.h>
#include <jlog.h>
int main() {
jlog_ctx *ctx;
const char *path = "/var/log/jlogexample";
int rc;
jlog_id begin, end;
int count;
ctx = jlog_new(path);
if (jlog_ctx_open_reader(ctx, "one") != 0) {
fprintf(stderr, "jlog_ctx_open_reader failed: %d %s\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx));
exit(1);
}
count = jlog_ctx_read_interval(ctx, &begin, &end);
if (count > 0) {
int i;
jlog_message m;
for (i = 0; i < count; i++, JLOG_ID_ADVANCE(&begin)) {
end = begin;
if (jlog_ctx_read_message(ctx, &begin, &m) == 0){
printf("Got: %.*s\n", m.mess_len, (char *)m.mess);
} else {
fprintf(stderr, "jlog_ctx_read_message failed: %d %s\n", jlog_ctx_err(ctx), jlog_ctx_err_string(ctx));
}
}
jlog_ctx_read_checkpoint(ctx, &end);
}
jlog_ctx_close(ctx);
}
Hello,
could anyone explain how can I build and use jlog in a python script?
$ python test_jlog.py
Traceback (most recent call last):
File "test_jlog.py", line 8, in <module>
from jlog import *
ImportError: No module named jlog
I used autoconf to generate the Makefile, but find some bugs in it:
install-python:
cd python && make install
clean:
rm -f *.o *.lo *.$(DOTSO) *.a jthreadtest jtest jlogctl jlogtail
rm -f java/*.jar java/*.jnilib java/*.lo
-if test -f perl/Makefile ; then cd perl ; make clean ; fi
cd python && make clean
can we really run make
command in the python folder?
We are assessing jlog and find out it is pretty good/solid product , meanwhile, we get excellent support from the maintainer , Theo. thank you !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.