abumq / easyloggingpp

C++ logging library. It is extremely powerful, extendable, light-weight, fast performing, thread and type safe and consists of many built-in features. It provides ability to write logs in your own customized format. It also provide support for logging your classes, third-party libraries, STL and third-party containers etc.
MIT License
3.75k stars 918 forks source link

Add shared library support and fix library install path on Linux #815

Open musicinmybrain opened 2 years ago

musicinmybrain commented 2 years ago

This is a

I have

This PR uses the major version number as the SOVERSION, which presumes that no ABI-breaking changes will be made without bumping the major version.

I see two test failures, neither of which was introduced by this PR:

[ RUN      ] CommandLineArgsTest.LoggingFlagsArg
/home/ben/src/forks/easyloggingpp/test/command-line-args-test.h:50: Failure
Value of: Loggers::hasFlag(LoggingFlag::NewLineForContainer)
  Actual: true
Expected: false
/home/ben/src/forks/easyloggingpp/test/command-line-args-test.h:51: Failure
Value of: Loggers::hasFlag(LoggingFlag::LogDetailedCrashReason)
  Actual: true
Expected: false
[  FAILED  ] CommandLineArgsTest.LoggingFlagsArg (0 ms)
[ RUN      ] HelpersTest.ConvertTemplateToStdString
/home/ben/src/forks/easyloggingpp/test/helpers-test.h:15: Failure
Expected equality of these values:
  "[1, 2, 3, 4]"
  strVecInt
    Which is: "[1\n    2\n    3\n    4]"
With diff:
@@ -1,1 +1,4 @@
-[1, 2, 3, 4]
+[1
+    2
+    3
+    4]

[  FAILED  ] HelpersTest.ConvertTemplateToStdString (0 ms)
musicinmybrain commented 2 years ago

Upon further investigation, given the number of configuration preprocessor macros affecting the compilation of the .cc file and intended to be set by the library user, it may not be practical to package this as a system-wide shared (or static) library for general use.

I think I will try to follow other distributions’ lead in packaging this as a header-only library, where the .cc file is “also a header” to be installed in, e.g., /usr/include/.

I will leave the PR here in case it is useful anyway…