From 90439a2f211b723a0cf6d699ca8cb4da7384580a Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 26 Oct 2016 23:08:04 +0200 Subject: sal::detail::logFormat is no longer needed ...since 97354578d7195bce927f0c00c4e2ae9cd7344776 "Remove the obsolete functionality originally underlying osl/diagnose.h" Change-Id: I7c920bca9cdddb37fcbbc15d8629d01c21eb0787 --- sal/osl/all/log.cxx | 27 +++++++++------------------ sal/osl/all/logformat.hxx | 29 ----------------------------- 2 files changed, 9 insertions(+), 47 deletions(-) delete mode 100644 sal/osl/all/logformat.hxx (limited to 'sal') diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx index afde14288962..00bd67cbb759 100644 --- a/sal/osl/all/log.cxx +++ b/sal/osl/all/log.cxx @@ -27,8 +27,6 @@ #include "sal/types.h" #include "misc.hxx" -#include "logformat.hxx" - #if defined ANDROID #include #elif defined WNT @@ -365,24 +363,17 @@ void sal_detail_logFormat( if (report(level, area)) { std::va_list args; va_start(args, format); - osl::detail::logFormat(level, area, where, format, args); + char buf[1024]; + int const len = sizeof buf - RTL_CONSTASCII_LENGTH("..."); + int n = vsnprintf(buf, len, format, args); + if (n < 0) { + std::strcpy(buf, "???"); + } else if (n >= len) { + std::strcpy(buf + len - 1, "..."); + } + log(level, area, where, buf); va_end(args); } } -void osl::detail::logFormat( - sal_detail_LogLevel level, char const * area, char const * where, - char const * format, std::va_list arguments) -{ - char buf[1024]; - int const len = sizeof buf - RTL_CONSTASCII_LENGTH("..."); - int n = vsnprintf(buf, len, format, arguments); - if (n < 0) { - std::strcpy(buf, "???"); - } else if (n >= len) { - std::strcpy(buf + len - 1, "..."); - } - log(level, area, where, buf); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/osl/all/logformat.hxx b/sal/osl/all/logformat.hxx deleted file mode 100644 index 0e579a9bfc54..000000000000 --- a/sal/osl/all/logformat.hxx +++ /dev/null @@ -1,29 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#ifndef INCLUDED_SAL_OSL_ALL_LOGFORMAT_HXX -#define INCLUDED_SAL_OSL_ALL_LOGFORMAT_HXX - -#include "sal/config.h" - -#include - -#include "sal/detail/log.h" - -namespace osl { namespace detail { - -void logFormat( - sal_detail_LogLevel level, char const * area, char const * where, - char const * format, std::va_list arguments); - -} } - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit