diff --git a/console_logger/getopt.h b/console_logger/getopt.h index e07bf88..15670f1 100644 --- a/console_logger/getopt.h +++ b/console_logger/getopt.h @@ -9,24 +9,24 @@ * warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /* -* Copyright (c) 2002 Todd C. Miller -* -* Permission to use, copy, modify, and distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -* -* Sponsored in part by the Defense Advanced Research Projects -* Agency (DARPA) and Air Force Research Laboratory, Air Force -* Materiel Command, USAF, under agreement number F39502-99-1-0512. -*/ + * Copyright (c) 2002 Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. + */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. diff --git a/include/graylog_logger/LoggingBase.hpp b/include/graylog_logger/LoggingBase.hpp index 83f302a..417047f 100644 --- a/include/graylog_logger/LoggingBase.hpp +++ b/include/graylog_logger/LoggingBase.hpp @@ -58,9 +58,10 @@ class LoggingBase { } virtual void log(const Severity Level, const std::string &Message, const std::pair &ExtraField) { - log(Level, Message, std::vector>{ - ExtraField, - }); + log(Level, Message, + std::vector>{ + ExtraField, + }); } #ifdef WITH_FMT @@ -109,7 +110,7 @@ class LoggingBase { virtual bool flush(std::chrono::system_clock::duration TimeOut) { auto FlushCompleted = std::make_shared>(); auto FlushCompletedValue = FlushCompleted->get_future(); - Executor.SendWork([ =, FlushCompleted{std::move(FlushCompleted)} ]() { + Executor.SendWork([=, FlushCompleted{std::move(FlushCompleted)}]() { std::vector> FlushResults; for (auto &CHandler : Handlers) { FlushResults.push_back(std::async( diff --git a/src/ConsoleInterface.cpp b/src/ConsoleInterface.cpp index 46a7683..8479019 100644 --- a/src/ConsoleInterface.cpp +++ b/src/ConsoleInterface.cpp @@ -33,7 +33,7 @@ void ConsoleInterface::addMessage(const LogMessage &Message) { bool ConsoleInterface::flush(std::chrono::system_clock::duration TimeOut) { auto WorkDone = std::make_shared>(); auto WorkDoneFuture = WorkDone->get_future(); - Executor.SendWork([ =, WorkDone{std::move(WorkDone)} ]() { + Executor.SendWork([=, WorkDone{std::move(WorkDone)}]() { std::cout.flush(); WorkDone->set_value(); }); diff --git a/src/FileInterface.cpp b/src/FileInterface.cpp index a26b9bf..4d111dc 100644 --- a/src/FileInterface.cpp +++ b/src/FileInterface.cpp @@ -36,7 +36,7 @@ void FileInterface::addMessage(const LogMessage &Message) { bool FileInterface::flush(std::chrono::system_clock::duration TimeOut) { auto WorkDone = std::make_shared>(); auto WorkDoneFuture = WorkDone->get_future(); - Executor.SendWork([ =, WorkDone{std::move(WorkDone)} ]() { + Executor.SendWork([=, WorkDone{std::move(WorkDone)}]() { FileStream.flush(); WorkDone->set_value(); }); diff --git a/src/GraylogConnection.cpp b/src/GraylogConnection.cpp index 8a1ab69..edcbe41 100644 --- a/src/GraylogConnection.cpp +++ b/src/GraylogConnection.cpp @@ -205,7 +205,7 @@ bool GraylogConnection::Impl::flush( std::chrono::system_clock::duration TimeOut) { auto WorkDone = std::make_shared>(); auto WorkDoneFuture = WorkDone->get_future(); - LogMessages.try_enqueue([WorkDone = std::move(WorkDone)]()->std::string { + LogMessages.try_enqueue([WorkDone = std::move(WorkDone)]() -> std::string { WorkDone->set_value(); return {}; }); diff --git a/src/LoggingBase.cpp b/src/LoggingBase.cpp index f3eb786..98737bd 100644 --- a/src/LoggingBase.cpp +++ b/src/LoggingBase.cpp @@ -123,7 +123,7 @@ void LoggingBase::setMinSeverity(Severity Level) { auto WorkDone = std::make_shared>(); auto WorkDoneFuture = WorkDone->get_future(); Executor.SendWork( - [ =, WorkDone{std::move(WorkDone)} ]() { MinSeverity = Level; }); + [=, WorkDone{std::move(WorkDone)}]() { MinSeverity = Level; }); WorkDoneFuture.wait(); } diff --git a/unit_tests/ConsoleInterfaceTest.cpp b/unit_tests/ConsoleInterfaceTest.cpp index 576e5e4..d00e3df 100644 --- a/unit_tests/ConsoleInterfaceTest.cpp +++ b/unit_tests/ConsoleInterfaceTest.cpp @@ -6,8 +6,8 @@ // Copyright © 2016 European Spallation Source. All rights reserved. // -#include "Semaphore.hpp" #include "graylog_logger/ConsoleInterface.hpp" +#include "Semaphore.hpp" #include #include diff --git a/unit_tests/FileInterfaceTest.cpp b/unit_tests/FileInterfaceTest.cpp index 79b67f9..08b403a 100644 --- a/unit_tests/FileInterfaceTest.cpp +++ b/unit_tests/FileInterfaceTest.cpp @@ -6,8 +6,8 @@ // Copyright © 2016 European Spallation Source. All rights reserved. // -#include "Semaphore.hpp" #include "graylog_logger/FileInterface.hpp" +#include "Semaphore.hpp" #include "graylog_logger/Log.hpp" #include #include diff --git a/unit_tests/GraylogInterfaceTest.cpp b/unit_tests/GraylogInterfaceTest.cpp index fa6e585..78761f9 100644 --- a/unit_tests/GraylogInterfaceTest.cpp +++ b/unit_tests/GraylogInterfaceTest.cpp @@ -6,9 +6,9 @@ // Copyright © 2016 European Spallation Source. All rights reserved. // +#include "graylog_logger/GraylogInterface.hpp" #include "LogTestServer.hpp" #include "Semaphore.hpp" -#include "graylog_logger/GraylogInterface.hpp" #include #include #include diff --git a/unit_tests/LoggingBaseTest.cpp b/unit_tests/LoggingBaseTest.cpp index e79aece..b091564 100644 --- a/unit_tests/LoggingBaseTest.cpp +++ b/unit_tests/LoggingBaseTest.cpp @@ -6,10 +6,10 @@ // Copyright © 2016 European Spallation Source. All rights reserved. // +#include "graylog_logger/LoggingBase.hpp" #include "BaseLogHandlerStandIn.hpp" #include "graylog_logger/LibConfig.hpp" #include "graylog_logger/LogUtil.hpp" -#include "graylog_logger/LoggingBase.hpp" #include #include #include