Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
ed6532b9
Commit
ed6532b9
authored
May 12, 2014
by
gabi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace constexpr with const becasuse vs2013 lack of support
parent
3d5ee3ff
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
289 additions
and
11 deletions
+289
-11
ReadMe.txt
c11logtest/c11logtest/ReadMe.txt
+40
-0
c11logtest.vcxproj
c11logtest/c11logtest/c11logtest.vcxproj
+113
-0
c11logtest.vcxproj.filters
c11logtest/c11logtest/c11logtest.vcxproj.filters
+91
-0
stdafx.cpp
c11logtest/c11logtest/stdafx.cpp
+8
-0
stdafx.h
c11logtest/c11logtest/stdafx.h
+15
-0
targetver.h
c11logtest/c11logtest/targetver.h
+8
-0
example.cpp
example/example.cpp
+4
-4
fast_oss.h
include/c11log/details/fast_oss.h
+2
-1
line_logger.h
include/c11log/details/line_logger.h
+0
-1
stack_buf.h
include/c11log/details/stack_buf.h
+1
-1
formatter.h
include/c11log/formatter.h
+2
-0
logger.h
include/c11log/logger.h
+5
-4
No files found.
c11logtest/c11logtest/ReadMe.txt
0 → 100644
View file @
ed6532b9
========================================================================
CONSOLE APPLICATION : c11logtest Project Overview
========================================================================
AppWizard has created this c11logtest application for you.
This file contains a summary of what you will find in each of the files that
make up your c11logtest application.
c11logtest.vcxproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
c11logtest.vcxproj.filters
This is the filters file for VC++ projects generated using an Application Wizard.
It contains information about the association between the files in your project
and the filters. This association is used in the IDE to show grouping of files with
similar extensions under a specific node (for e.g. ".cpp" files are associated with the
"Source Files" filter).
c11logtest.cpp
This is the main application source file.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named c11logtest.pch and a precompiled types file named StdAfx.obj.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////
c11logtest/c11logtest/c11logtest.vcxproj
0 → 100644
View file @
ed6532b9
<?xml version="1.0" encoding="utf-8"?>
<Project
DefaultTargets=
"Build"
ToolsVersion=
"12.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<ItemGroup
Label=
"ProjectConfigurations"
>
<ProjectConfiguration
Include=
"Debug|Win32"
>
<Configuration>
Debug
</Configuration>
<Platform>
Win32
</Platform>
</ProjectConfiguration>
<ProjectConfiguration
Include=
"Release|Win32"
>
<Configuration>
Release
</Configuration>
<Platform>
Win32
</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup
Label=
"Globals"
>
<ProjectGuid>
{DC7F2F3E-0D0E-4324-A278-410DBC4045AD}
</ProjectGuid>
<Keyword>
Win32Proj
</Keyword>
<RootNamespace>
c11logtest
</RootNamespace>
</PropertyGroup>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.Default.props"
/>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
Label=
"Configuration"
>
<ConfigurationType>
Application
</ConfigurationType>
<UseDebugLibraries>
true
</UseDebugLibraries>
<PlatformToolset>
v120
</PlatformToolset>
<CharacterSet>
Unicode
</CharacterSet>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
Label=
"Configuration"
>
<ConfigurationType>
Application
</ConfigurationType>
<UseDebugLibraries>
false
</UseDebugLibraries>
<PlatformToolset>
v120
</PlatformToolset>
<WholeProgramOptimization>
true
</WholeProgramOptimization>
<CharacterSet>
Unicode
</CharacterSet>
</PropertyGroup>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.props"
/>
<ImportGroup
Label=
"ExtensionSettings"
>
</ImportGroup>
<ImportGroup
Label=
"PropertySheets"
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
<Import
Project=
"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition=
"exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label=
"LocalAppDataPlatform"
/>
</ImportGroup>
<ImportGroup
Label=
"PropertySheets"
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
<Import
Project=
"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition=
"exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label=
"LocalAppDataPlatform"
/>
</ImportGroup>
<PropertyGroup
Label=
"UserMacros"
/>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
<LinkIncremental>
true
</LinkIncremental>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
<LinkIncremental>
false
</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>
Level3
</WarningLevel>
<Optimization>
Disabled
</Optimization>
<PreprocessorDefinitions>
WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
../../include
</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>
Console
</SubSystem>
<GenerateDebugInformation>
true
</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
<ClCompile>
<WarningLevel>
Level3
</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>
MaxSpeed
</Optimization>
<FunctionLevelLinking>
true
</FunctionLevelLinking>
<IntrinsicFunctions>
true
</IntrinsicFunctions>
<PreprocessorDefinitions>
WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
../../include
</AdditionalIncludeDirectories>
<BufferSecurityCheck>
false
</BufferSecurityCheck>
<EnableEnhancedInstructionSet>
StreamingSIMDExtensions2
</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>
Console
</SubSystem>
<GenerateDebugInformation>
true
</GenerateDebugInformation>
<EnableCOMDATFolding>
true
</EnableCOMDATFolding>
<OptimizeReferences>
true
</OptimizeReferences>
<Profile>
true
</Profile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text
Include=
"ReadMe.txt"
/>
</ItemGroup>
<ItemGroup>
<ClInclude
Include=
"..\..\include\c11log\common_types.h"
/>
<ClInclude
Include=
"..\..\include\c11log\details\blocking_queue.h"
/>
<ClInclude
Include=
"..\..\include\c11log\details\factory.h"
/>
<ClInclude
Include=
"..\..\include\c11log\details\fast_oss.h"
/>
<ClInclude
Include=
"..\..\include\c11log\details\flush_helper.h"
/>
<ClInclude
Include=
"..\..\include\c11log\details\line_logger.h"
/>
<ClInclude
Include=
"..\..\include\c11log\details\log_msg.h"
/>
<ClInclude
Include=
"..\..\include\c11log\details\os.h"
/>
<ClInclude
Include=
"..\..\include\c11log\details\stack_buf.h"
/>
<ClInclude
Include=
"..\..\include\c11log\formatter.h"
/>
<ClInclude
Include=
"..\..\include\c11log\logger.h"
/>
<ClInclude
Include=
"..\..\include\c11log\sinks\async_sink.h"
/>
<ClInclude
Include=
"..\..\include\c11log\sinks\base_sink.h"
/>
<ClInclude
Include=
"..\..\include\c11log\sinks\console_sinks.h"
/>
<ClInclude
Include=
"..\..\include\c11log\sinks\file_sinks.h"
/>
<ClInclude
Include=
"stdafx.h"
/>
<ClInclude
Include=
"targetver.h"
/>
</ItemGroup>
<ItemGroup>
<ClCompile
Include=
"..\..\example\example.cpp"
/>
<ClCompile
Include=
"stdafx.cpp"
/>
</ItemGroup>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.targets"
/>
<ImportGroup
Label=
"ExtensionTargets"
>
</ImportGroup>
</Project>
\ No newline at end of file
c11logtest/c11logtest/c11logtest.vcxproj.filters
0 → 100644
View file @
ed6532b9
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"4.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<ItemGroup>
<Filter
Include=
"Source Files"
>
<UniqueIdentifier>
{4FC737F1-C7A5-4376-A066-2A32D752A2FF}
</UniqueIdentifier>
<Extensions>
cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
</Extensions>
</Filter>
<Filter
Include=
"Header Files"
>
<UniqueIdentifier>
{93995380-89BD-4b04-88EB-625FBE52EBFB}
</UniqueIdentifier>
<Extensions>
h;hh;hpp;hxx;hm;inl;inc;xsd
</Extensions>
</Filter>
<Filter
Include=
"Resource Files"
>
<UniqueIdentifier>
{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
</UniqueIdentifier>
<Extensions>
rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
</Extensions>
</Filter>
<Filter
Include=
"Header Files\c11log"
>
<UniqueIdentifier>
{bad4e9e3-82bd-4b02-9b4a-43198cc65844}
</UniqueIdentifier>
</Filter>
<Filter
Include=
"Header Files\c11log\details"
>
<UniqueIdentifier>
{a4cc3c0e-8713-4146-98c7-1e7ab4ed95f8}
</UniqueIdentifier>
</Filter>
<Filter
Include=
"Header Files\c11log\sinks"
>
<UniqueIdentifier>
{87170f3b-5292-49b8-8581-7db7cb9abd29}
</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<Text
Include=
"ReadMe.txt"
/>
</ItemGroup>
<ItemGroup>
<ClInclude
Include=
"stdafx.h"
>
<Filter>
Header Files
</Filter>
</ClInclude>
<ClInclude
Include=
"targetver.h"
>
<Filter>
Header Files
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\common_types.h"
>
<Filter>
Header Files\c11log
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\formatter.h"
>
<Filter>
Header Files\c11log
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\logger.h"
>
<Filter>
Header Files\c11log
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\details\blocking_queue.h"
>
<Filter>
Header Files\c11log\details
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\details\factory.h"
>
<Filter>
Header Files\c11log\details
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\details\fast_oss.h"
>
<Filter>
Header Files\c11log\details
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\details\flush_helper.h"
>
<Filter>
Header Files\c11log\details
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\details\line_logger.h"
>
<Filter>
Header Files\c11log\details
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\details\log_msg.h"
>
<Filter>
Header Files\c11log\details
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\details\os.h"
>
<Filter>
Header Files\c11log\details
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\details\stack_buf.h"
>
<Filter>
Header Files\c11log\details
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\sinks\async_sink.h"
>
<Filter>
Header Files\c11log\sinks
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\sinks\base_sink.h"
>
<Filter>
Header Files\c11log\sinks
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\sinks\console_sinks.h"
>
<Filter>
Header Files\c11log\sinks
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\sinks\file_sinks.h"
>
<Filter>
Header Files\c11log\sinks
</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile
Include=
"stdafx.cpp"
>
<Filter>
Source Files
</Filter>
</ClCompile>
<ClCompile
Include=
"..\..\example\example.cpp"
>
<Filter>
Source Files
</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
c11logtest/c11logtest/stdafx.cpp
0 → 100644
View file @
ed6532b9
// stdafx.cpp : source file that includes just the standard includes
// c11logtest.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
c11logtest/c11logtest/stdafx.h
0 → 100644
View file @
ed6532b9
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
// TODO: reference additional headers your program requires here
c11logtest/c11logtest/targetver.h
0 → 100644
View file @
ed6532b9
#pragma once
// Including SDKDDKVer.h defines the highest available Windows platform.
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
#include <SDKDDKVer.h>
example/example.cpp
View file @
ed6532b9
...
...
@@ -16,7 +16,7 @@ using namespace utils;
int
main
(
int
argc
,
char
*
argv
[])
{
const
unsigned
int
howmany
=
argc
<=
1
?
1
000000
:
atoi
(
argv
[
1
]);
const
unsigned
int
howmany
=
argc
<=
1
?
5
000000
:
atoi
(
argv
[
1
]);
logger
cout_logger
(
"example"
,
sinks
::
stdout_sink
());
cout_logger
.
info
()
<<
"Hello logger"
;
...
...
@@ -37,9 +37,9 @@ int main(int argc, char* argv[])
auto
delta
=
system_clock
::
now
()
-
start
;
auto
delta_d
=
duration_cast
<
duration
<
double
>>
(
delta
).
count
();
cout
_logger
.
info
(
"Total:"
)
<<
format
(
howmany
)
;
cout
_logger
.
info
(
"Delta:"
)
<<
format
(
delta_d
)
;
cout
_logger
.
info
(
"Rate:"
)
<<
format
(
howmany
/
delta_d
)
<<
"/sec"
;
cout
<<
"Total:"
<<
format
(
howmany
)
<<
endl
;
cout
<<
"Delta:"
<<
format
(
delta_d
)
<<
endl
;
cout
<<
"Rate:"
<<
format
(
howmany
/
delta_d
)
<<
"/sec"
<<
endl
;
return
0
;
}
include/c11log/details/fast_oss.h
View file @
ed6532b9
...
...
@@ -4,6 +4,7 @@
// uses stack_buf as the underlying buffer (upto 192 bytes before using the heap)
#include <ostream>
#include <iomanip>
#include "stack_buf.h"
namespace
c11log
...
...
@@ -14,7 +15,7 @@ namespace details
class
stack_devicebuf
:
public
std
::
streambuf
{
public
:
static
constexpr
unsigned
short
stack_size
=
192
;
static
const
unsigned
short
stack_size
=
192
;
using
stackbuf_t
=
stack_buf
<
stack_size
>
;
stack_devicebuf
()
=
default
;
...
...
include/c11log/details/line_logger.h
View file @
ed6532b9
...
...
@@ -6,7 +6,6 @@
#include "fast_oss.h"
// line_logger class.
// aggregates single log line (on the stack if possibe) and calls the logger upon destruction
...
...
include/c11log/details/stack_buf.h
View file @
ed6532b9
...
...
@@ -17,7 +17,7 @@ class stack_buf
public
:
using
bufpair_t
=
std
::
pair
<
const
char
*
,
std
::
size_t
>
;
using
iterator
=
char
const
*
;
static
const
expr
unsigned
short
stack_size
=
STACK_SIZE
;
static
const
unsigned
short
stack_size
=
STACK_SIZE
;
stack_buf
()
:
_v
(),
_stack_size
(
0
)
{}
~
stack_buf
()
=
default
;
...
...
include/c11log/formatter.h
View file @
ed6532b9
...
...
@@ -34,10 +34,12 @@ public:
{
details
::
fast_oss
oss
;
_format_time
(
msg
.
time
,
oss
);
if
(
!
msg
.
logger_name
.
empty
())
oss
<<
" ["
<<
msg
.
logger_name
<<
':'
<<
c11log
::
level
::
to_str
(
msg
.
level
)
<<
"] "
;
else
oss
<<
" ["
<<
c11log
::
level
::
to_str
(
msg
.
level
)
<<
"] "
;
oss
<<
msg
.
raw
<<
details
::
os
::
eol
();
msg
.
formatted
=
oss
.
str
();
}
...
...
include/c11log/logger.h
View file @
ed6532b9
...
...
@@ -31,7 +31,7 @@ public:
using
sinks_vector_t
=
std
::
vector
<
sink_ptr
>
;
using
sinks_init_list
=
std
::
initializer_list
<
sink_ptr
>
;
using
formatter_ptr
=
std
::
shared
_ptr
<
c11log
::
formatters
::
formatter
>
;
using
formatter_ptr
=
std
::
unique
_ptr
<
c11log
::
formatters
::
formatter
>
;
logger
(
const
std
::
string
&
name
,
sinks_init_list
,
formatter_ptr
=
nullptr
);
logger
(
const
std
::
string
&
name
,
sink_ptr
,
formatter_ptr
=
nullptr
);
...
...
@@ -92,18 +92,19 @@ logger& get_logger(const std::string& name);
inline
c11log
::
logger
::
logger
(
const
std
::
string
&
name
,
sinks_init_list
sinks_list
,
formatter_ptr
f
)
:
_logger_name
(
name
),
_formatter
(
f
),
_formatter
(
std
::
move
(
f
)
),
_sinks
(
sinks_list
)
{
//Seems that vs2013 doesnt support std::atomic member initialization, so its done here
_min_level
=
level
::
INFO
;
if
(
!
_formatter
)
_formatter
=
std
::
make_shared
<
formatters
::
default_formatter
>
();
_formatter
=
std
::
make_unique
<
formatters
::
default_formatter
>
();
}
inline
c11log
::
logger
::
logger
(
const
std
::
string
&
name
,
sink_ptr
sink
,
formatter_ptr
f
)
:
logger
(
name
,
{
sink
},
f
)
{}
logger
(
name
,
{
sink
},
std
::
move
(
f
)
)
{}
...
...
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