Skip to content

Commit

Permalink
Simplify test_package
Browse files Browse the repository at this point in the history
  • Loading branch information
AbrilRBS authored May 29, 2024
1 parent fa5d579 commit 289732e
Showing 1 changed file with 1 addition and 136 deletions.
137 changes: 1 addition & 136 deletions recipes/logr/v0.7/test_package/test_package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,61 +12,7 @@

int main() {
auto logger = logr::basic_ostream_logger_t<1024u>(std::cout);
logger.trace( "Hello World! [raw message]" );
logger.trace( LOGR_SRC_LOCATION, "Hello World! [raw message]" );

logger.trace( []() { return "Hello World! [cb]"; } );
logger.trace( LOGR_SRC_LOCATION, []() { return "Hello World! [cb]"; } );

logger.trace( []( auto out ) {
format_to( out, "Hello {}! [{}]", "World", "cb with explicit out" );
} );

logger.trace( LOGR_SRC_LOCATION, []( auto out ) {
format_to( out, "Hello {}! [{}]", "World", "cb with explicit out" );
} );

logger.trace( LOGR_SRC_LOCATION, []( auto out ) {
format_to( out,
FMT_STRING( "Hello {}! [{}]" ),
"World",
"cb with explicit out and FMT_STRING" );
} );

logger.trace( LOGR_SRC_LOCATION, []( auto out ) {
format_to( out,
fmt::runtime( "Hello {}! [{}]" ),
"World",
"cb with explicit out and runtime-string" );
} );

logger.debug( "Hello World! [raw message]" );
logger.debug( LOGR_SRC_LOCATION, "Hello World! [raw message]" );

logger.debug( []() { return "Hello World! [cb]"; } );
logger.debug( LOGR_SRC_LOCATION, []() { return "Hello World! [cb]"; } );

logger.debug( []( auto out ) {
format_to( out, "Hello {}! [{}]", "World", "cb with explicit out" );
} );

logger.debug( LOGR_SRC_LOCATION, []( auto out ) {
format_to( out, "Hello {}! [{}]", "World", "cb with explicit out" );
} );
logger.debug( LOGR_SRC_LOCATION, []( auto out ) {
format_to( out,
FMT_STRING( "Hello {}! [{}]" ),
"World",
"cb with explicit out and FMT_STRING" );
} );

logger.debug( LOGR_SRC_LOCATION, []( auto out ) {
format_to( out,
fmt::runtime( "Hello {}! [{}]" ),
"World",
"cb with explicit out and runtime-string" );
} );


logger.info( "Hello World! [raw message]" );
logger.info( LOGR_SRC_LOCATION, "Hello World! [raw message]" );

Expand Down Expand Up @@ -94,87 +40,6 @@ int main() {
"cb with explicit out and runtime-string" );
} );

logger.warn( "Hello World! [raw message]" );
logger.warn( LOGR_SRC_LOCATION, "Hello World! [raw message]" );

logger.warn( []() { return "Hello World! [cb]"; } );
logger.warn( LOGR_SRC_LOCATION, []() { return "Hello World! [cb]"; } );

logger.warn( []( auto out ) {
format_to( out, "Hello {}! [{}]", "World", "cb with explicit out" );
} );

logger.warn( LOGR_SRC_LOCATION, []( auto out ) {
format_to( out, "Hello {}! [{}]", "World", "cb with explicit out" );
} );
logger.warn( LOGR_SRC_LOCATION, []( auto out ) {
format_to( out,
FMT_STRING( "Hello {}! [{}]" ),
"World",
"cb with explicit out and FMT_STRING" );
} );

logger.warn( LOGR_SRC_LOCATION, []( auto out ) {
format_to( out,
fmt::runtime( "Hello {}! [{}]" ),
"World",
"cb with explicit out and runtime-string" );
} );

logger.error( "Hello World! [raw message]" );
logger.error( LOGR_SRC_LOCATION, "Hello World! [raw message]" );

logger.error( []() { return "Hello World! [cb]"; } );
logger.error( LOGR_SRC_LOCATION, []() { return "Hello World! [cb]"; } );

logger.error( []( auto out ) {
format_to( out, "Hello {}! [{}]", "World", "cb with explicit out" );
} );

logger.error( LOGR_SRC_LOCATION, []( auto out ) {
format_to( out, "Hello {}! [{}]", "World", "cb with explicit out" );
} );
logger.error( LOGR_SRC_LOCATION, []( auto out ) {
format_to( out,
FMT_STRING( "Hello {}! [{}]" ),
"World",
"cb with explicit out and FMT_STRING" );
} );

logger.error( LOGR_SRC_LOCATION, []( auto out ) {
format_to( out,
fmt::runtime( "Hello {}! [{}]" ),
"World",
"cb with explicit out and runtime-string" );
} );

logger.critical( "Hello World! [raw message]" );
logger.critical( LOGR_SRC_LOCATION, "Hello World! [raw message]" );

logger.critical( []() { return "Hello World! [cb]"; } );
logger.critical( LOGR_SRC_LOCATION, []() { return "Hello World! [cb]"; } );

logger.critical( []( auto out ) {
format_to( out, "Hello {}! [{}]", "World", "cb with explicit out" );
} );

logger.critical( LOGR_SRC_LOCATION, []( auto out ) {
format_to( out, "Hello {}! [{}]", "World", "cb with explicit out" );
} );
logger.critical( LOGR_SRC_LOCATION, []( auto out ) {
format_to( out,
FMT_STRING( "Hello {}! [{}]" ),
"World",
"cb with explicit out and FMT_STRING" );
} );

logger.critical( LOGR_SRC_LOCATION, []( auto out ) {
format_to( out,
fmt::runtime( "Hello {}! [{}]" ),
"World",
"cb with explicit out and runtime-string" );
} );

logger.flush();

return 0;
Expand Down

0 comments on commit 289732e

Please sign in to comment.