Commit e9cc6f51 authored by Kasper Marstal's avatar Kasper Marstal
Browse files

GIT: Remove logger work in progress from develop branch

parent 7dd06e77
......@@ -92,7 +92,6 @@ include_directories( ${Boost_INCLUDE_DIRS} )
# For now we just enable all modules
include( selxModules )
selxmodule_enable( ModuleCore )
selxmodule_enable( ModuleLog )
selxmodule_enable( ModuleExamples )
selxmodule_enable( ModuleSinksAndSources )
selxmodule_enable( ModuleItkSmoothingRecursiveGaussianImageFilter )
......
#=========================================================================
#
# Copyright Leiden University Medical Center, Erasmus University Medical
# Center and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#=========================================================================
set( MODULE ModuleLog )
# Export include files
set( ${MODULE}_INCLUDE_DIRS
${${MODULE}_SOURCE_DIR}/include
)
# Collect header files for Visual Studio Project
file(GLOB ${MODULE}_HEADER_FILES "${${MODULE}_SOURCE_DIR}/include/*.*")
# Export libraries
set( ${MODULE}_LIBRARIES
${MODULE}
)
# Export tests
set( ${MODULE}_TESTS
${${MODULE}_SOURCE_DIR}/test/selxLogComponentTest.cxx
)
# Module source files
set( ${MODULE}_SOURCE_FILES
${${MODULE}_SOURCE_DIR}/src/selxLogComponent.cxx
)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(BOOST_LIBRARYDIR ${BOOST_ROOT}/stage/lib)
find_package(Boost COMPONENTS log REQUIRED)
# Compile library
add_library( ${MODULE} STATIC "${${MODULE}_SOURCE_FILES}" ${${MODULE}_HEADER_FILES})
target_link_libraries( ${MODULE} ${SUPERELASTIX_LIBRARIES} ${Boost_LIBRARIES} )
/*=========================================================================
*
* Copyright Leiden University Medical Center, Erasmus University Medical
* Center and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef selxLogComponent_h
#define selxLogComponent_h
#include "selxInterfaces.h"
#include "selxSuperElastixComponent.h"
#include <boost/log/core.hpp>
#include <boost/log/trivial.hpp>
namespace selx
{
class LogComponent :
public SuperElastixComponent<
Accepting< >,
Providing
<
LogInterface
>
>
{
public:
//@kasper: somehow the selxNewMacro does not work. The itkNewMacro, however works. Something to figure out why...
//selxNewMacro( LogComponent, ComponentBase );
/** Standard class typedefs. */
typedef LogComponent Self;
typedef ComponentBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** New macro for creation of through the object factory. */
//selxNewMacro(Self, ComponentBase);
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(LogComponent, ComponentBase);
LogComponent();
virtual ~LogComponent(){};
virtual std::stringstream Log( boost::log::trivial::severity_level severity_level ) override;
virtual bool MeetsCriterion(const CriterionType & criterion) override;
static const char * GetDescription() { return "Log Component"; }
private:
boost::log::trivial::severity_level m_LogLevel;
};
}
#endif // selxLogComponent_h
\ No newline at end of file
/*=========================================================================
*
* Copyright Leiden University Medical Center, Erasmus University Medical
* Center and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef selxLogComponent_cxx
#define selxLogComponent_cxx
#include "selxLogComponent.h"
#include "selxMacro.h"
namespace selx
{
LogComponent
::LogComponent( void )
{
// this->m_LogLevel = boost::log::trivial::severity_level::info;
}
std::stringstream
LogComponent
::Log( boost::log::trivial::severity_level severity_level )
{
//return BOOST_LOG_TRIVIAL( ::boost::log::keywords::severity = severity_level );
return std::stringstream();
}
bool
LogComponent
::MeetsCriterion( const CriterionType & criterion )
{
bool meetsCriteria( false );
if( criterion.first == "LogLevel" )
{
meetsCriteria = true;
//for( auto const & criterionValue : criterion.second ) // auto&& preferred?
//{
//if( criterionValue != "INFO" ) // e.g. "GradientDescent", "SupportsSparseSamples
//{
// meetsCriteria = false;
//}
//}
}
return meetsCriteria;
}
}
#endif // selxLogComponent_cxx
/*=========================================================================
*
* Copyright Leiden University Medical Center, Erasmus University Medical
* Center and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#include "selxLogComponent.h"
#include "gtest/gtest.h"
using namespace selx;
TEST( selxLogComponent, Initialization )
{
LogComponent::Pointer logger = LogComponent::New();
EXPECT_TRUE( true );
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment