diff options
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/all/log.cxx | 27 | ||||
-rw-r--r-- | sal/osl/all/logformat.hxx | 29 |
2 files changed, 9 insertions, 47 deletions
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 <android/log.h> #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 <cstdarg> - -#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: */ |