Skip to content

Commit

Permalink
progress3...
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Artsishevsky <[email protected]>
  • Loading branch information
polter-rnd committed Jan 7, 2025
1 parent bfee440 commit b443190
Show file tree
Hide file tree
Showing 19 changed files with 73 additions and 80 deletions.
7 changes: 0 additions & 7 deletions .iwyu-mappings
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,4 @@
# Bug on libc++ w/o fmtlib: std::reference_wrapper is not from <type_traits>
{ symbol: [ "std::reference_wrapper", "private", "<functional>", "public" ] },
{ symbol: [ "std::copy", "private", "<algorithm>", "public" ] },
# Bug on fmtlib: format_error::~format_error is not from "format.h"
{ include: [ "\"format.h\"", "private", "<slimlog/format.h>", "public" ] },
{ include: [ "\"slimlog/format.h\"", "private", "<slimlog/format.h>", "public" ] },
{ include: [ "\"slimlog/level.h\"", "private", "<slimlog/level.h>", "public" ] },
{ include: [ "\"slimlog/record.h\"", "private", "<slimlog/record.h>", "public" ] },
{ include: [ "\"slimlog/location.h\"", "private", "<slimlog/location.h>", "public" ] },
{ include: [ "\"slimlog/policy.h\"", "private", "<slimlog/policy.h>", "public" ] },
]
4 changes: 2 additions & 2 deletions include/slimlog/format-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

#pragma once

// IWYU pragma: private, include <slimlog/format.h>
// IWYU pragma: private, include "slimlog/format.h"

#include <slimlog/format.h> // IWYU pragma: associated
#include "slimlog/format.h" // IWYU pragma: associated

#ifdef SLIMLOG_FMTLIB
#if __has_include(<fmt/base.h>)
Expand Down
10 changes: 5 additions & 5 deletions include/slimlog/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

#pragma once

#include "slimlog/location.h"
#include "slimlog/util/buffer.h"
#include "slimlog/util/types.h"

#ifdef SLIMLOG_FMTLIB
#if __has_include(<fmt/base.h>)
#include <fmt/base.h>
Expand All @@ -18,10 +22,6 @@
#include <format>
#endif

#include <slimlog/location.h>
#include <slimlog/util/buffer.h>
#include <slimlog/util/types.h>

#include <chrono>
#include <concepts>
#include <cstring>
Expand Down Expand Up @@ -367,5 +367,5 @@ struct std::formatter<SlimLog::FormatValue<T, Char>, Char> { // NOLINT(cert-dcl5
#endif

#ifdef SLIMLOG_HEADER_ONLY
#include <slimlog/format-inl.h> // IWYU pragma: keep
#include "slimlog/format-inl.h" // IWYU pragma: keep
#endif
12 changes: 6 additions & 6 deletions include/slimlog/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

#pragma once

#include <slimlog/format.h>
#include <slimlog/level.h>
#include <slimlog/location.h>
#include <slimlog/policy.h>
#include <slimlog/sink.h>
#include <slimlog/util/types.h>
#include "slimlog/format.h"
#include "slimlog/level.h"
#include "slimlog/location.h"
#include "slimlog/policy.h"
#include "slimlog/sink.h"
#include "slimlog/util/types.h"

#include <cstddef>
#include <memory>
Expand Down
8 changes: 4 additions & 4 deletions include/slimlog/pattern-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

#pragma once

// IWYU pragma: private, include <slimlog/pattern.h>
// IWYU pragma: private, include "slimlog/pattern.h"

#include <slimlog/pattern.h> // IWYU pragma: associated
#include <slimlog/util/types.h>
#include <slimlog/util/unicode.h>
#include "slimlog/pattern.h" // IWYU pragma: associated
#include "slimlog/util/types.h"
#include "slimlog/util/unicode.h"

#include <algorithm>
#include <climits>
Expand Down
8 changes: 4 additions & 4 deletions include/slimlog/pattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

#pragma once

#include <slimlog/format.h>
#include <slimlog/level.h>
#include <slimlog/record.h>
#include "slimlog/format.h"
#include "slimlog/level.h"
#include "slimlog/record.h"

#include <array>
#include <chrono>
Expand Down Expand Up @@ -371,5 +371,5 @@ class Pattern {
} // namespace SlimLog

#ifdef SLIMLOG_HEADER_ONLY
#include <slimlog/pattern-inl.h> // IWYU pragma: keep
#include "slimlog/pattern-inl.h" // IWYU pragma: keep
#endif
6 changes: 3 additions & 3 deletions include/slimlog/record-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

#pragma once

// IWYU pragma: private, include <slimlog/record.h>
// IWYU pragma: private, include "slimlog/record.h"

#include <slimlog/record.h> // IWYU pragma: associated
#include <slimlog/util/unicode.h>
#include "slimlog/record.h" // IWYU pragma: associated
#include "slimlog/util/unicode.h"

#include <utility>

Expand Down
4 changes: 2 additions & 2 deletions include/slimlog/record.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#pragma once

#include <slimlog/level.h>
#include "slimlog/level.h"

#include <atomic>
#include <chrono>
Expand Down Expand Up @@ -131,5 +131,5 @@ struct Record {
} // namespace SlimLog

#ifdef SLIMLOG_HEADER_ONLY
#include <slimlog/record-inl.h> // IWYU pragma: keep
#include "slimlog/record-inl.h" // IWYU pragma: keep
#endif
8 changes: 4 additions & 4 deletions include/slimlog/sink-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

#pragma once

// IWYU pragma: private, include <slimlog/sink.h>
// IWYU pragma: private, include "slimlog/sink.h"

#ifndef SLIMLOG_HEADER_ONLY
#include <slimlog/logger.h>
#include "slimlog/logger.h"
#endif

#include <slimlog/sink.h> // IWYU pragma: associated
#include <slimlog/util/os.h>
#include "slimlog/sink.h" // IWYU pragma: associated
#include "slimlog/util/os.h"

#include <algorithm> // IWYU pragma: keep
#include <iterator>
Expand Down
16 changes: 8 additions & 8 deletions include/slimlog/sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

#pragma once

#include <slimlog/format.h>
#include <slimlog/level.h>
#include <slimlog/location.h>
#include <slimlog/pattern.h>
#include <slimlog/policy.h>
#include <slimlog/record.h>
#include <slimlog/util/types.h>
#include "slimlog/format.h"
#include "slimlog/level.h"
#include "slimlog/location.h"
#include "slimlog/pattern.h"
#include "slimlog/policy.h"
#include "slimlog/record.h"
#include "slimlog/util/types.h"

#include <cstddef>
#include <initializer_list>
Expand Down Expand Up @@ -403,5 +403,5 @@ class SinkDriver final {
} // namespace SlimLog

#ifdef SLIMLOG_HEADER_ONLY
#include <slimlog/sink-inl.h> // IWYU pragma: keep
#include "slimlog/sink-inl.h" // IWYU pragma: keep
#endif
4 changes: 2 additions & 2 deletions include/slimlog/sinks/file_sink-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

#pragma once

// IWYU pragma: private, include <slimlog/sinks/file_sink.h>
// IWYU pragma: private, include "slimlog/sinks/file_sink.h"

#include <slimlog/sinks/file_sink.h> // IWYU pragma: associated
#include "slimlog/sinks/file_sink.h" // IWYU pragma: associated

#if defined(_WIN32) && defined(__STDC_WANT_SECURE_LIB__)
// In addition to <cstdio> below for fopen_s() on Windows
Expand Down
8 changes: 4 additions & 4 deletions include/slimlog/sinks/file_sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

#pragma once

#include <slimlog/logger.h>
#include <slimlog/sink.h>
#include <slimlog/util/types.h>
#include "slimlog/logger.h"
#include "slimlog/sink.h"
#include "slimlog/util/types.h"

#include <cstdio>
#include <memory>
Expand Down Expand Up @@ -75,5 +75,5 @@ class FileSink : public FormattableSink<String, Char, BufferSize, Allocator> {
} // namespace SlimLog

#ifdef SLIMLOG_HEADER_ONLY
#include <slimlog/sinks/file_sink-inl.h> // IWYU pragma: keep
#include "slimlog/sinks/file_sink-inl.h" // IWYU pragma: keep
#endif
4 changes: 2 additions & 2 deletions include/slimlog/sinks/null_sink-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

#pragma once

// IWYU pragma: private, include <slimlog/sinks/null_sink.h>
// IWYU pragma: private, include "slimlog/sinks/null_sink.h"

#include <slimlog/sinks/null_sink.h> // IWYU pragma: associated
#include "slimlog/sinks/null_sink.h" // IWYU pragma: associated

namespace SlimLog {

Expand Down
6 changes: 3 additions & 3 deletions include/slimlog/sinks/null_sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

#pragma once

#include <slimlog/sink.h>
#include <slimlog/util/types.h>
#include "slimlog/sink.h"
#include "slimlog/util/types.h"

#include <string_view>
#include <utility>
Expand Down Expand Up @@ -55,5 +55,5 @@ class NullSink : public Sink<String, Char> {
} // namespace SlimLog

#ifdef SLIMLOG_HEADER_ONLY
#include <slimlog/sinks/null_sink-inl.h> // IWYU pragma: keep
#include "slimlog/sinks/null_sink-inl.h" // IWYU pragma: keep
#endif
4 changes: 2 additions & 2 deletions include/slimlog/sinks/ostream_sink-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

#pragma once

// IWYU pragma: private, include <slimlog/sinks/ostream_sink.h>
// IWYU pragma: private, include "slimlog/sinks/ostream_sink.h"

#include <slimlog/sinks/ostream_sink.h> // IWYU pragma: associated
#include "slimlog/sinks/ostream_sink.h" // IWYU pragma: associated

namespace SlimLog {

Expand Down
8 changes: 4 additions & 4 deletions include/slimlog/sinks/ostream_sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

#pragma once

#include <slimlog/logger.h>
#include <slimlog/sink.h>
#include <slimlog/util/types.h>
#include "slimlog/logger.h"
#include "slimlog/sink.h"
#include "slimlog/util/types.h"

#include <cstddef>
#include <memory>
Expand Down Expand Up @@ -83,5 +83,5 @@ class OStreamSink : public FormattableSink<String, Char, BufferSize, Allocator>
} // namespace SlimLog

#ifdef SLIMLOG_HEADER_ONLY
#include <slimlog/sinks/ostream_sink-inl.h> // IWYU pragma: keep
#include "slimlog/sinks/ostream_sink-inl.h" // IWYU pragma: keep
#endif
2 changes: 1 addition & 1 deletion include/slimlog/util/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <fmt/core.h>
#endif
#else
#include <slimlog/util/types.h>
#include "slimlog/util/types.h"

#include <iterator>
#endif
Expand Down
2 changes: 1 addition & 1 deletion include/slimlog/util/unicode.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#pragma once

#include <slimlog/util/types.h>
#include "slimlog/util/types.h"

#include <array>
#include <cassert>
Expand Down
32 changes: 16 additions & 16 deletions src/slimlog.cpp
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#include <slimlog/format.h>
#include <slimlog/logger.h>
#include <slimlog/pattern.h>
#include <slimlog/policy.h>
#include <slimlog/record.h>
#include <slimlog/sink.h>
#include <slimlog/sinks/file_sink.h>
#include <slimlog/sinks/null_sink.h>
#include <slimlog/sinks/ostream_sink.h>
#include "slimlog/format.h"
#include "slimlog/logger.h"
#include "slimlog/pattern.h"
#include "slimlog/policy.h"
#include "slimlog/record.h"
#include "slimlog/sink.h"
#include "slimlog/sinks/file_sink.h"
#include "slimlog/sinks/null_sink.h"
#include "slimlog/sinks/ostream_sink.h"

#ifndef SLIMLOG_HEADER_ONLY
// IWYU pragma: begin_keep
#include <slimlog/format-inl.h>
#include <slimlog/pattern-inl.h>
#include <slimlog/record-inl.h>
#include <slimlog/sink-inl.h>
#include <slimlog/sinks/file_sink-inl.h>
#include <slimlog/sinks/null_sink-inl.h>
#include <slimlog/sinks/ostream_sink-inl.h>
#include "slimlog/format-inl.h"
#include "slimlog/pattern-inl.h"
#include "slimlog/record-inl.h"
#include "slimlog/sink-inl.h"
#include "slimlog/sinks/file_sink-inl.h"
#include "slimlog/sinks/null_sink-inl.h"
#include "slimlog/sinks/ostream_sink-inl.h"
// IWYU pragma: end_keep
#endif

Expand Down

0 comments on commit b443190

Please sign in to comment.