• Ryan Wong's avatar
    Merge pull request #13909 from kinchungwong:logging_20190220 · 8af96248
    Ryan Wong authored
    OE-11 Logging revamp (#13909)
    
    * Initial commit for log tag support.
    
    Part of #11003, incomplete. Should pass build.
    
    Moved LogLevel enum to logger.defines.hpp
    
    LogTag struct used to convey both name and log level threshold as
    one argument to the new logging macro. See logtag.hpp file, and
    CV_LOG_WITH_TAG macro.
    
    Global log level is now associated with a global log tag, when a
    logging statement doesn't specify any log tag. See getLogLevel and
    getGlobalLogTag functions.
    
    A macro CV_LOGTAG_FALLBACK is allowed to be re-defined by other modules
    or compilation units, internally, so that logging statements inside
    that unit that specify NULL as tag will fall back to the re-defined tag.
    
    Line-of-code information (file name, line number, function name),
    together with tag name, are passed into the new log message sink.
    See writeLogMessageEx function.
    
    Fixed old incorrect CV_LOG_VERBOSE usage in ocl4dnn_conv_spatial.cpp.
    
    * Implemented tag-based log filtering
    
    Added LogTagManager. This is an initial version, using standard C++
    approach as much as possible, to allow easier code review. Will
    optimize later.
    
    A workaround for all static dynamic initialization issues is
    implemented. Refer to code comments.
    
    * Added LogTagConfigParser.
    
    Note: new code does not fully handle old log config parsing behavior.
    
    * Fix log tag config vs registering ordering issue.
    
    * Started testing LogTagConfigParser, incomplete.
    
    The intention of this commit is to illustrate the capabilities of
    the current design of LogTagConfigParser.
    
    The test contained in this commit is not complete. Also, design changes
    may require throwing away this commit and rewriting test code from
    scratch.
    
    Does not test whitespace segmentation (multiple tags on the config);
    will do in next commit.
    
    * Added CV_LOGTAG_EXPAND_NAME macro
    
    This macro allows to be re-defined locally in other compilation units
    to apply a prefix to whatever argument is passed as the "tag" argument
    into CV_LOG_WITH_TAG. The default definition in logger.hpp does not
    modify the argument. It is recommended to include the address-of
    operator (ampersand) when re-defined locally.
    
    * Added a few tests for LogTagManager, some fail.
    
    See test_logtagmanager.cpp
    Failed tests are: non-global ("something"), setting level by name-part
    (first part or any part) has no effect at all.
    
    * LogTagManagerTests substring non-confusion tests
    
    * Fix major bugs in LogTagManager
    
    The code change is intended to approximate the spec documented in
    https://gist.github.com/kinchungwong/ec25bc1eba99142e0be4509b0f67d0c6
    
    Refer to test suite in test_logtagmanager.cpp
    
    Filter test result in "opencv_test_core" ...
    with gtest_filter "LogTagManager*"
    
    To see the test code that finds the bugs, refer to original commits
    (before rebase; might be gone)
    
    .. f3451208 (2019-03-03T19:45:17Z)
    .... LogTagManagerTests substring non-confusion tests
    
    .. 1b848f5f (2019-03-03T01:55:18Z)
    .... Added a few tests for LogTagManager, some fail.
    
    * Added LogTagManagerNamePartNonConfusionTest.
    
    See test_logtagmanager.cpp in modules/core/test.
    
    * Added LogTagAuto for auto registration in ctor
    
    * Rewritten LogTagManager to resolve issues.
    
    * Resolves code review issues around 2019-04-10
    
    LogTagConfigParser::parseLogLevel - as part of resolving code review
    issues, this function is rewritten to simplify control flow and to
    improve conformance with legacy usage (for string values "OFF",
    "DISABLED", and "WARNINGS").
    8af96248
Name
Last commit
Last update
..
cuda Loading commit data...
opencl Loading commit data...
utils Loading commit data...
algorithm.cpp Loading commit data...
alloc.cpp Loading commit data...
arithm.cpp Loading commit data...
arithm.dispatch.cpp Loading commit data...
arithm.simd.hpp Loading commit data...
arithm_ipp.hpp Loading commit data...
array.cpp Loading commit data...
batch_distance.cpp Loading commit data...
bindings_utils.cpp Loading commit data...
bufferpool.impl.hpp Loading commit data...
channels.cpp Loading commit data...
check.cpp Loading commit data...
command_line_parser.cpp Loading commit data...
conjugate_gradient.cpp Loading commit data...
convert.dispatch.cpp Loading commit data...
convert.hpp Loading commit data...
convert.simd.hpp Loading commit data...
convert_c.cpp Loading commit data...
convert_scale.dispatch.cpp Loading commit data...
convert_scale.simd.hpp Loading commit data...
copy.cpp Loading commit data...
count_non_zero.dispatch.cpp Loading commit data...
count_non_zero.simd.hpp Loading commit data...
cuda_gpu_mat.cpp Loading commit data...
cuda_host_mem.cpp Loading commit data...
cuda_info.cpp Loading commit data...
cuda_stream.cpp Loading commit data...
datastructs.cpp Loading commit data...
directx.cpp Loading commit data...
directx.inc.hpp Loading commit data...
downhill_simplex.cpp Loading commit data...
dxt.cpp Loading commit data...
gl_core_3_1.cpp Loading commit data...
gl_core_3_1.hpp Loading commit data...
glob.cpp Loading commit data...
hal_internal.cpp Loading commit data...
hal_internal.hpp Loading commit data...
hal_replacement.hpp Loading commit data...
intel_gpu_gemm.inl.hpp Loading commit data...
kmeans.cpp Loading commit data...
lapack.cpp Loading commit data...
lda.cpp Loading commit data...
logger.cpp Loading commit data...
lpsolver.cpp Loading commit data...
lut.cpp Loading commit data...
mathfuncs.cpp Loading commit data...
mathfuncs.hpp Loading commit data...
mathfuncs_core.dispatch.cpp Loading commit data...
mathfuncs_core.simd.hpp Loading commit data...
matmul.dispatch.cpp Loading commit data...
matmul.simd.hpp Loading commit data...
matrix.cpp Loading commit data...
matrix_c.cpp Loading commit data...
matrix_decomp.cpp Loading commit data...
matrix_expressions.cpp Loading commit data...
matrix_iterator.cpp Loading commit data...
matrix_operations.cpp Loading commit data...
matrix_sparse.cpp Loading commit data...
matrix_wrap.cpp Loading commit data...
mean.dispatch.cpp Loading commit data...
mean.simd.hpp Loading commit data...
merge.dispatch.cpp Loading commit data...
merge.simd.hpp Loading commit data...
minmax.cpp Loading commit data...
norm.cpp Loading commit data...
ocl.cpp Loading commit data...
ocl_deprecated.hpp Loading commit data...
opengl.cpp Loading commit data...
out.cpp Loading commit data...
ovx.cpp Loading commit data...
parallel.cpp Loading commit data...
parallel_impl.cpp Loading commit data...
parallel_impl.hpp Loading commit data...
pca.cpp Loading commit data...
persistence.cpp Loading commit data...
persistence.hpp Loading commit data...
persistence_json.cpp Loading commit data...
persistence_types.cpp Loading commit data...
persistence_xml.cpp Loading commit data...
persistence_yml.cpp Loading commit data...
precomp.hpp Loading commit data...
rand.cpp Loading commit data...
softfloat.cpp Loading commit data...
split.dispatch.cpp Loading commit data...
split.simd.hpp Loading commit data...
stat.dispatch.cpp Loading commit data...
stat.hpp Loading commit data...
stat.simd.hpp Loading commit data...
stat_c.cpp Loading commit data...
stl.cpp Loading commit data...
sum.dispatch.cpp Loading commit data...
sum.simd.hpp Loading commit data...
system.cpp Loading commit data...
tables.cpp Loading commit data...
trace.cpp Loading commit data...
types.cpp Loading commit data...
umatrix.cpp Loading commit data...
umatrix.hpp Loading commit data...
va_intel.cpp Loading commit data...