diff options
Diffstat (limited to 'tests/logging/logging_test.c')
-rw-r--r-- | tests/logging/logging_test.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/logging/logging_test.c b/tests/logging/logging_test.c index b9cb57fb..3548b1dd 100644 --- a/tests/logging/logging_test.c +++ b/tests/logging/logging_test.c @@ -13,10 +13,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * */ #include <osmocom/core/logging.h> @@ -77,10 +73,16 @@ int main(int argc, char **argv) stderr_target = log_target_create_stderr(); log_add_target(stderr_target); log_set_all_filter(stderr_target, 1); - log_set_print_filename(stderr_target, 0); + log_set_print_filename2(stderr_target, LOG_FILENAME_NONE); + log_set_print_category_hex(stderr_target, 0); log_set_print_category(stderr_target, 1); log_set_use_color(stderr_target, 0); + if (argc > 1 && !strcmp(argv[1], "wqueue")) + log_target_file_switch_to_wqueue(stderr_target); + else + log_target_file_switch_to_stream(stderr_target); + log_parse_category_mask(stderr_target, "DRLL:DCC"); log_parse_category_mask(stderr_target, "DRLL"); @@ -128,5 +130,13 @@ int main(int argc, char **argv) log_set_category_filter(stderr_target, DLGLOBAL, 1, LOGL_DEBUG); DEBUGP(DLGLOBAL, "You should see this (DLGLOBAL on DEBUG)\n"); + /* Test printing of the filename */ + log_set_print_filename2(stderr_target, LOG_FILENAME_BASENAME); + + log_set_print_filename_pos(stderr_target, LOG_FILENAME_POS_HEADER_END); + DEBUGP(DLGLOBAL, "A message with source info printed first\n"); + log_set_print_filename_pos(stderr_target, LOG_FILENAME_POS_LINE_END); + DEBUGP(DLGLOBAL, "A message with source info printed last\n"); + return 0; } |