Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
1234cda3
Unverified
Commit
1234cda3
authored
Jan 10, 2021
by
Charles Milette
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't build the example with wide filenames
parent
fc594b55
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
appveyor.yml
appveyor.yml
+9
-1
example/example.cpp
example/example.cpp
+5
-5
No files found.
appveyor.yml
View file @
1234cda3
...
...
@@ -7,41 +7,49 @@ environment:
WCHAR
:
'
OFF'
WCHAR_FILES
:
'
OFF'
BUILD_SHARED
:
'
OFF'
BUILD_EXAMPLE
:
'
ON'
-
GENERATOR
:
'
"Visual
Studio
14
2015"'
BUILD_TYPE
:
Release
WCHAR
:
'
ON'
WCHAR_FILES
:
'
OFF'
BUILD_SHARED
:
'
OFF'
BUILD_EXAMPLE
:
'
ON'
-
GENERATOR
:
'
"Visual
Studio
14
2015
Win64"'
BUILD_TYPE
:
Debug
WCHAR
:
'
ON'
WCHAR_FILES
:
'
OFF'
BUILD_SHARED
:
'
OFF'
BUILD_EXAMPLE
:
'
ON'
-
GENERATOR
:
'
"Visual
Studio
14
2015
Win64"'
BUILD_TYPE
:
Release
WCHAR
:
'
ON'
WCHAR_FILES
:
'
OFF'
BUILD_SHARED
:
'
OFF'
BUILD_EXAMPLE
:
'
ON'
-
GENERATOR
:
'
"Visual
Studio
15
2017
Win64"'
BUILD_TYPE
:
Debug
WCHAR
:
'
ON'
WCHAR_FILES
:
'
OFF'
BUILD_SHARED
:
'
OFF'
BUILD_EXAMPLE
:
'
ON'
-
GENERATOR
:
'
"Visual
Studio
15
2017
Win64"'
BUILD_TYPE
:
Release
WCHAR
:
'
OFF'
WCHAR_FILES
:
'
OFF'
BUILD_SHARED
:
'
OFF'
BUILD_EXAMPLE
:
'
ON'
-
GENERATOR
:
'
"Visual
Studio
15
2017
Win64"'
BUILD_TYPE
:
Release
WCHAR
:
'
OFF'
WCHAR_FILES
:
'
OFF'
BUILD_SHARED
:
'
ON'
BUILD_EXAMPLE
:
'
ON'
-
GENERATOR
:
'
"Visual
Studio
15
2017
Win64"'
BUILD_TYPE
:
Release
WCHAR
:
'
ON'
WCHAR_FILES
:
'
ON'
BUILD_SHARED
:
'
ON'
BUILD_EXAMPLE
:
'
OFF'
build_script
:
-
cmd
:
>-
set
...
...
@@ -52,7 +60,7 @@ build_script:
set PATH=%PATH%;C:\Program Files\Git\usr\bin
cmake .. -G %GENERATOR% -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DSPDLOG_WCHAR_SUPPORT=%WCHAR% -DSPDLOG_WCHAR_FILENAMES=%WCHAR_FILES% -DSPDLOG_BUILD_SHARED=%BUILD_SHARED% -DSPDLOG_BUILD_EXAMPLE=
ON -DSPDLOG_BUILD_EXAMPLE_HO=ON
-DSPDLOG_BUILD_TESTS=ON -DSPDLOG_BUILD_TESTS_HO=OFF -DSPDLOG_BUILD_WARNINGS=ON
cmake .. -G %GENERATOR% -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DSPDLOG_WCHAR_SUPPORT=%WCHAR% -DSPDLOG_WCHAR_FILENAMES=%WCHAR_FILES% -DSPDLOG_BUILD_SHARED=%BUILD_SHARED% -DSPDLOG_BUILD_EXAMPLE=
%BUILD_EXAMPLE% -DSPDLOG_BUILD_EXAMPLE_HO=%BUILD_EXAMPLE%
-DSPDLOG_BUILD_TESTS=ON -DSPDLOG_BUILD_TESTS_HO=OFF -DSPDLOG_BUILD_WARNINGS=ON
cmake --build . --config %BUILD_TYPE%
...
...
example/example.cpp
View file @
1234cda3
...
...
@@ -109,21 +109,21 @@ void stdout_logger_example()
void
basic_example
()
{
// Create basic file logger (not rotated).
auto
my_logger
=
spdlog
::
basic_logger_mt
(
"file_logger"
,
SPDLOG_FILENAME_T
(
"logs/basic-log.txt"
)
);
auto
my_logger
=
spdlog
::
basic_logger_mt
(
"file_logger"
,
"logs/basic-log.txt"
);
}
#include "spdlog/sinks/rotating_file_sink.h"
void
rotating_example
()
{
// Create a file rotating logger with 5mb size max and 3 rotated files.
auto
rotating_logger
=
spdlog
::
rotating_logger_mt
(
"some_logger_name"
,
SPDLOG_FILENAME_T
(
"logs/rotating.txt"
)
,
1048576
*
5
,
3
);
auto
rotating_logger
=
spdlog
::
rotating_logger_mt
(
"some_logger_name"
,
"logs/rotating.txt"
,
1048576
*
5
,
3
);
}
#include "spdlog/sinks/daily_file_sink.h"
void
daily_example
()
{
// Create a daily logger - a new file is created every day on 2:30am.
auto
daily_logger
=
spdlog
::
daily_logger_mt
(
"daily_logger"
,
SPDLOG_FILENAME_T
(
"logs/daily.txt"
)
,
2
,
30
);
auto
daily_logger
=
spdlog
::
daily_logger_mt
(
"daily_logger"
,
"logs/daily.txt"
,
2
,
30
);
}
#include "spdlog/cfg/env.h"
...
...
@@ -143,7 +143,7 @@ void async_example()
{
// Default thread pool settings can be modified *before* creating the async logger:
// spdlog::init_thread_pool(32768, 1); // queue with max 32k items 1 backing thread.
auto
async_file
=
spdlog
::
basic_logger_mt
<
spdlog
::
async_factory
>
(
"async_file_logger"
,
SPDLOG_FILENAME_T
(
"logs/async_log.txt"
)
);
auto
async_file
=
spdlog
::
basic_logger_mt
<
spdlog
::
async_factory
>
(
"async_file_logger"
,
"logs/async_log.txt"
);
// alternatively:
// auto async_file = spdlog::create_async<spdlog::sinks::basic_file_sink_mt>("async_file_logger", "logs/async_log.txt");
...
...
@@ -211,7 +211,7 @@ void multi_sink_example()
console_sink
->
set_level
(
spdlog
::
level
::
warn
);
console_sink
->
set_pattern
(
"[multi_sink_example] [%^%l%$] %v"
);
auto
file_sink
=
std
::
make_shared
<
spdlog
::
sinks
::
basic_file_sink_mt
>
(
SPDLOG_FILENAME_T
(
"logs/multisink.txt"
)
,
true
);
auto
file_sink
=
std
::
make_shared
<
spdlog
::
sinks
::
basic_file_sink_mt
>
(
"logs/multisink.txt"
,
true
);
file_sink
->
set_level
(
spdlog
::
level
::
trace
);
spdlog
::
logger
logger
(
"multi_sink"
,
{
console_sink
,
file_sink
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment