Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Setting up fmt with custom config structure for logging system #2964

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
be1e774
[core] New implementation for the logging/formatting system
ethouris May 24, 2024
308af58
Fixed parts in non-default-enabled code parts
ethouris May 24, 2024
5ae2a03
Updated sfmt.h with reimplementation fixes
ethouris May 25, 2024
089dd51
Fixed heavy logging cases and atomics. Withdrawn changes for enums. U…
ethouris May 25, 2024
e37d37d
Provided a special version for atomic. Withdrawn unnecessary changes
ethouris May 26, 2024
6ce84fe
Changed more formatting usage to sfmt
ethouris May 26, 2024
8126c49
Removed ostringstream from utilities
ethouris May 26, 2024
216c1ed
Removed ostringstream use. Fixed C++03 problem with Ensure declaration
May 27, 2024
d8cebcd
Cleared out warn-errors for logging-off version
May 27, 2024
4e39fd7
Moved Printable out of C++11-dependent section (args... no longer nee…
May 27, 2024
5199746
Added extra version of snprintf for old Windows
ethouris May 27, 2024
4843143
Fixed the use of std::atomic
ethouris May 28, 2024
1a0eca4
Fixed the right atomic type used with logging. Fixed some reported sh…
ethouris May 28, 2024
9643702
Fixed a clang-reported warning (to trigger rebuilding)
ethouris May 28, 2024
f4ecbc1
Updated sfmt.h, fixed sync formatting
Jun 17, 2024
b90f540
Updated and merged
Jun 17, 2024
7660e92
Merge branch 'master' into dev-add-sfmt-for-logging
Jun 18, 2024
0a607c7
Some cosmetic fixes. Fixed the use of std::abs
Jun 18, 2024
d2ec1cf
Fixed usage of <cmath> with std
Jun 19, 2024
193fe39
Fixed correct includes for std::div
Jun 19, 2024
c81d4d6
Renamed sfmt.h and moved to srt namespace
Jun 20, 2024
0920fbf
[core] Setting up fmt with iomanip for logging system
Jun 25, 2024
f4088e4
Removed the use of sfmt obufstream
Jun 25, 2024
e48a6cb
Removed named reference to avoid dangling ref warning
Jun 25, 2024
2ba12a0
Added lacking include for sstream
Jun 25, 2024
f16fed7
Cleaned up previous usage of sfmt facilities
Jun 26, 2024
a49bdd9
Provided C++03 version of fmt
Jun 27, 2024
8b4d44c
Added some fixes as attempt to compile in C++03 (failed)
Jul 11, 2024
eed8c3f
Added separate C++03 compatible fmt API
Jul 18, 2024
4b6c56e
Removed commented-out previous code
Jul 18, 2024
e1617ea
Removed commented-out code
Jul 18, 2024
ac3d5d5
Moved overloaded operator << to inside the class
Jul 18, 2024
d1ae64d
Added C++11 flag that could be handled also on Windows
Jul 19, 2024
7472f05
Attempting to force C++11 in MICROSOFT to compile tools
Jul 19, 2024
4acdf00
Changed the way to require C++11 in apps.
Jul 19, 2024
d8bda01
Blocked unused function reported as warn/error
Jul 19, 2024
d0f472f
Merge branch 'master' into dev-add-custom-fmt-for-logging
Jul 22, 2024
061ec3b
Added UDL for fmt_stringview to simplify raw string format passing
Jul 22, 2024
1a6ce38
Added some more fixes with use of ofmt
Jul 23, 2024
05b5bb7
[maint] Removed VC 2013. Added VC 2022
Jul 25, 2024
a8664d2
Merge branch 'main-ci-remove-old-windows' into dev-add-custom-fmt-for…
Jul 26, 2024
880fa9d
Reworked the fmt API
Jul 26, 2024
fecce73
Updated and fixed
Sep 3, 2024
51350b1
Removed copyright notice blindly copied from another project
Sep 3, 2024
f0bfba8
Added more replacement for stringstream. Removed unused CIPAddress::show
Sep 11, 2024
8f82530
Updated and fixed
Sep 24, 2024
6106607
Merge branch 'master' into dev-add-custom-fmt-for-logging
ethouris Sep 24, 2024
a8dbce8
Merge branch 'master' into dev-add-custom-fmt-for-logging
Oct 18, 2024
59435c2
Merge branch 'master' into dev-add-custom-fmt-for-logging
Dec 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/apputil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
#include <chrono>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <utility>
#include <memory>

#include "srt.h" // Required for SRT_SYNC_CLOCK_* definitions.
#include "apputil.hpp"
#include "netinet_any.h"
#include "srt_compat.h"
#include "ofmt.h"

using namespace std;
using namespace srt;
Expand Down Expand Up @@ -147,7 +147,7 @@ string Join(const vector<string>& in, string sep)
if ( in.empty() )
return "";

ostringstream os;
srt::ofmtstream os;

os << in[0];
for (auto i = in.begin()+1; i != in.end(); ++i)
Expand Down
3 changes: 2 additions & 1 deletion apps/logsupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "logsupport.hpp"
#include "../srtcore/srt.h"
#include "../srtcore/utilities.h"
#include "../srtcore/ofmt.h"

using namespace std;

Expand Down Expand Up @@ -173,7 +174,7 @@ set<srt_logging::LogFA> SrtParseLogFA(string fa, set<string>* punknown)

void ParseLogFASpec(const vector<string>& speclist, string& w_on, string& w_off)
{
std::ostringstream son, soff;
srt::ofmtstream son, soff;

for (auto& s: speclist)
{
Expand Down
6 changes: 2 additions & 4 deletions apps/transmitmedia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#endif

#include "netinet_any.h"
#include "ofmt.h"
#include "apputil.hpp"
#include "socketoptions.hpp"
#include "uriparser.hpp"
Expand Down Expand Up @@ -519,10 +520,7 @@ SrtCommon::~SrtCommon()
SrtSource::SrtSource(string host, int port, const map<string,string>& par)
{
Init(host, port, par, false);

ostringstream os;
os << host << ":" << port;
hostport_copy = os.str();
hostport_copy = srt::ocat(host, OFMT_RAWSTR(":"), port);
}

int SrtSource::Read(size_t chunk, MediaPacket& pkt, ostream &out_stats)
Expand Down
2 changes: 1 addition & 1 deletion apps/uriparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ string UriParser::makeUri()
prefix = m_proto + "://";
}

std::ostringstream out;
srt::ofmtstream out;

out << prefix << m_host;
if ((m_port == "" || m_port == "0") && m_expect == EXPECT_FILE)
Expand Down
2 changes: 1 addition & 1 deletion apps/verbose.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ inline void Print(Log& ) {}
template <typename Arg1, typename... Args>
inline void Print(Log& out, Arg1&& arg1, Args&&... args)
{
out << std::forward(arg1);
out << arg1;
Print(out, args...);
}

Expand Down
Loading
Loading