Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

add logging #854

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

lukaszstolarczuk
Copy link
Member

@lukaszstolarczuk lukaszstolarczuk commented Dec 4, 2020

it's based on PMDK's logging.

For now it's not working on tests-examples compilation:

...
[ 21%] Linking CXX executable sorted_get_all_gen_params
/usr/bin/ld: CMakeFiles/example-pmemkv_basic_cpp.dir/pmemkv_basic_cpp/pmemkv_basic.cpp.o: in function `pmem::kv::db::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, pmem::kv::config&&)':
/home/luke/repos/luke/pmemkv/examples/../src/libpmemkv.hpp:821: undefined reference to `out_init'
/usr/bin/ld: /home/luke/repos/luke/pmemkv/examples/../src/libpmemkv.hpp:823: undefined reference to `out_log'
collect2: error: ld returned 1 exit status
make[2]: *** [examples/CMakeFiles/example-pmemkv_basic_cpp.dir/build.make:85: examples/example-pmemkv_basic_cpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:742: examples/CMakeFiles/example-pmemkv_basic_cpp.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 21%] Linking CXX executable example-pmemkv_open_cpp
/usr/bin/ld: CMakeFiles/sorted_get_all_gen_params.dir/engine_scenarios/sorted/get_all_gen_params.cc.o: in function `pmem::kv::db::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, pmem::kv::config&&)':
/home/luke/repos/luke/pmemkv/tests/../src/libpmemkv.hpp:821: undefined reference to `out_init'
/usr/bin/ld: /home/luke/repos/luke/pmemkv/tests/../src/libpmemkv.hpp:823: undefined reference to `out_log'
/usr/bin/ld: CMakeFiles/sorted_get_all_gen_params.dir/engine_scenarios/sorted/get_all_gen_params.cc.o: in function `pmem::kv::db::close()':
/home/luke/repos/luke/pmemkv/tests/../src/libpmemkv.hpp:834: undefined reference to `out_log'
/usr/bin/ld: /home/luke/repos/luke/pmemkv/tests/../src/libpmemkv.hpp:837: undefined reference to `out_fini'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/CMakeFiles/sorted_get_all_gen_params.dir/build.make:87: tests/sorted_get_all_gen_params] Error 1
make[1]: *** [CMakeFiles/Makefile2:1365: tests/CMakeFiles/sorted_get_all_gen_params.dir/all] Error 2
/usr/bin/ld: CMakeFiles/example-pmemkv_open_cpp.dir/pmemkv_open_cpp/pmemkv_open.cpp.o: in function `pmem::kv::db::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, pmem::kv::config&&)':
/home/luke/repos/luke/pmemkv/examples/../src/libpmemkv.hpp:821: undefined reference to `out_init'
/usr/bin/ld: /home/luke/repos/luke/pmemkv/examples/../src/libpmemkv.hpp:823: undefined reference to `out_log'
collect2: error: ld returned 1 exit status
make[2]: *** [examples/CMakeFiles/example-pmemkv_open_cpp.dir/build.make:85: examples/example-pmemkv_open_cpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:823: examples/CMakeFiles/example-pmemkv_open_cpp.dir/all] Error 2
[ 22%] Linking CXX executable example-pmemkv_pmemobj_cpp
/usr/bin/ld: CMakeFiles/example-pmemkv_pmemobj_cpp.dir/pmemkv_pmemobj_cpp/pmemkv_pmemobj.cpp.o: in function `pmem::kv::db::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, pmem::kv::config&&)':
/home/luke/repos/luke/pmemkv/examples/../src/libpmemkv.hpp:821: undefined reference to `out_init'
/usr/bin/ld: /home/luke/repos/luke/pmemkv/examples/../src/libpmemkv.hpp:823: undefined reference to `out_log'
collect2: error: ld returned 1 exit status
make[2]: *** [examples/CMakeFiles/example-pmemkv_pmemobj_cpp.dir/build.make:85: examples/example-pmemkv_pmemobj_cpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:796: examples/CMakeFiles/example-pmemkv_pmemobj_cpp.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

This change is Reviewable

Copy link
Contributor

@igchor igchor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 12 files reviewed, 1 unresolved discussion (waiting on @lukaszstolarczuk)


src/libpmemkv.hpp, line 16 at r1 (raw file):

#include "libpmemkv.h"
#include "logging.h"

We don't want to have any logging here - it's the public header and the logging.h/out.h will not be installed, right? Everything should be logged within the library.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants