Commit ba3c94af authored by Gabi Melman's avatar Gabi Melman

Create gh-pages branch via GitHub

parents
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Spdlog by gabime</title>
<link rel="stylesheet" href="stylesheets/styles.css">
<link rel="stylesheet" href="stylesheets/pygment_trac.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="javascripts/respond.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--[if lt IE 8]>
<link rel="stylesheet" href="stylesheets/ie.css">
<![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
</head>
<body>
<div id="header">
<nav>
<li class="fork"><a href="https://github.com/gabime/spdlog">View On GitHub</a></li>
<li class="downloads"><a href="https://github.com/gabime/spdlog/zipball/master">ZIP</a></li>
<li class="downloads"><a href="https://github.com/gabime/spdlog/tarball/master">TAR</a></li>
<li class="title">DOWNLOADS</li>
</nav>
</div><!-- end header -->
<div class="wrapper">
<section>
<div id="title">
<h1>Spdlog</h1>
<p>Super fast C++ logging library.</p>
<hr>
<span class="credits left">Project maintained by <a href="https://github.com/gabime">gabime</a></span>
<span class="credits right">Hosted on GitHub Pages &mdash; Theme by <a href="https://twitter.com/michigangraham">mattgraham</a></span>
</div>
<h1>
<a name="spdlog" class="anchor" href="#spdlog"><span class="octicon octicon-link"></span></a>spdlog</h1>
<p>Very fast, header only, C++ logging library.</p>
<h2>
<a name="install" class="anchor" href="#install"><span class="octicon octicon-link"></span></a>Install</h2>
<p>Just copy the files to your build tree and use a C++11 compiler</p>
<h2>
<a name="tested-on" class="anchor" href="#tested-on"><span class="octicon octicon-link"></span></a>Tested on:</h2>
<ul>
<li>gcc 4.8.1 and above</li>
<li>clang 3.5</li>
<li>visual studio 2013</li>
</ul>
<h2>
<a name="features" class="anchor" href="#features"><span class="octicon octicon-link"></span></a>Features</h2>
<ul>
<li>Very low overhead</li>
<li>Stream like, easy to use interface</li>
<li>Logging levels</li>
<li>Rotating log files</li>
<li>Daily log files</li>
<li>Async logging</li>
<li>Thread safety</li>
<li>Custom formatting</li>
</ul>
<h2>
<a name="performance" class="anchor" href="#performance"><span class="octicon octicon-link"></span></a>Performance</h2>
<p>The library is very fast.
Here are some benchmarks (Ubuntu, Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz)</p>
<pre><code>*******************************************************************************
Single thread, 250,000 iterations, flush every 1000 lines
*******************************************************************************
rotating_st... 817,860 lines/sec
daily_st... 827,820 lines /sec
*******************************************************************************
4 threads sharing same logger, 250,000 iterations, flush every 1000 lines
*******************************************************************************
rotating_mt... 1,476,013 lines/sec
daily_mt... 1,477,619 lines/sec
</code></pre>
<h2>
<a name="usage-example" class="anchor" href="#usage-example"><span class="octicon octicon-link"></span></a>Usage Example</h2>
<pre><code>#include &lt;iostream&gt;
#include "spdlog/spdlog.h"
int main(int, char* [])
{
namespace spd = spdlog;
try
{
std::string filename = "spdlog_example";
auto console = spd::stderr_logger_mt("console");
console-&gt;info("Welcome to spdlog!") ;
console-&gt;info() &lt;&lt; "Creating file " &lt;&lt; filename &lt;&lt; "..";
auto file_logger = spd::rotating_logger_mt("file_logger", filename, 1024 * 1024 * 5, 3);
file_logger-&gt;info("Log file message number", 1);
for (int i = 0; i &lt; 100; ++i)
{
auto square = i*i;
file_logger-&gt;info() &lt;&lt; i &lt;&lt; '*' &lt;&lt; i &lt;&lt; '=' &lt;&lt; square &lt;&lt; " (" &lt;&lt; "0x" &lt;&lt; std::hex &lt;&lt; square &lt;&lt; ")";
}
// Change log level to all loggers to warning and above
spd::set_level(spd::level::WARN);
console-&gt;info("This should not be displayed");
console-&gt;warn("This should!");
spd::set_level(spd::level::INFO);
// Change format pattern to all loggers
spd::set_pattern(" **** %Y-%m-%d %H:%M:%S.%e %l **** %v");
spd::get("console")-&gt;info("This is another message with different format");
}
catch (const spd::spdlog_ex&amp; ex)
{
std::cout &lt;&lt; "Log failed: " &lt;&lt; ex.what() &lt;&lt; std::endl;
}
return 0;
}
</code></pre>
</section>
</div>
<!--[if !IE]><script>fixScale(document);</script><![endif]-->
</body>
</html>
\ No newline at end of file
This diff is collapsed.
{"name":"Spdlog","tagline":"Super fast C++ logging library.","body":"# spdlog\r\n\r\nVery fast, header only, C++ logging library.\r\n\r\n\r\n## Install\r\nJust copy the files to your build tree and use a C++11 compiler\r\n\r\n\r\n## Tested on:\r\n* gcc 4.8.1 and above\r\n* clang 3.5\r\n* visual studio 2013\r\n\r\n##Features\r\n* Very low overhead\r\n* Stream like, easy to use interface\r\n* Logging levels\r\n* Rotating log files\r\n* Daily log files\r\n* Async logging\r\n* Thread safety\r\n* Custom formatting\r\n\r\n\r\n## Performance\r\nThe library is very fast. \r\nHere are some benchmarks (Ubuntu, Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz)\r\n```\r\n*******************************************************************************\r\nSingle thread, 250,000 iterations, flush every 1000 lines\r\n*******************************************************************************\r\nrotating_st...\t817,860 lines/sec\r\ndaily_st...\t\t827,820 lines /sec\r\n\r\n*******************************************************************************\r\n4 threads sharing same logger, 250,000 iterations, flush every 1000 lines\r\n*******************************************************************************\r\nrotating_mt...\t1,476,013 lines/sec\r\ndaily_mt...\t\t1,477,619 lines/sec\r\n```\r\n\r\n## Usage Example\r\n```\r\n#include <iostream>\r\n#include \"spdlog/spdlog.h\"\r\n\r\nint main(int, char* [])\r\n{\r\n namespace spd = spdlog;\r\n\r\n try\r\n {\r\n std::string filename = \"spdlog_example\";\r\n auto console = spd::stderr_logger_mt(\"console\");\r\n console->info(\"Welcome to spdlog!\") ;\r\n console->info() << \"Creating file \" << filename << \"..\";\r\n\r\n auto file_logger = spd::rotating_logger_mt(\"file_logger\", filename, 1024 * 1024 * 5, 3);\r\n file_logger->info(\"Log file message number\", 1);\r\n\r\n for (int i = 0; i < 100; ++i)\r\n {\r\n auto square = i*i;\r\n file_logger->info() << i << '*' << i << '=' << square << \" (\" << \"0x\" << std::hex << square << \")\";\r\n }\r\n\r\n // Change log level to all loggers to warning and above\r\n spd::set_level(spd::level::WARN);\r\n console->info(\"This should not be displayed\");\r\n console->warn(\"This should!\");\r\n spd::set_level(spd::level::INFO);\r\n\r\n // Change format pattern to all loggers\r\n spd::set_pattern(\" **** %Y-%m-%d %H:%M:%S.%e %l **** %v\");\r\n spd::get(\"console\")->info(\"This is another message with different format\");\r\n }\r\n catch (const spd::spdlog_ex& ex)\r\n {\r\n std::cout << \"Log failed: \" << ex.what() << std::endl;\r\n }\r\n return 0;\r\n}\r\n```","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}
\ No newline at end of file
nav {
display: none;
}
/* normalize.css 2012-02-07T12:37 UTC - http://github.com/necolas/normalize.css */
/* =============================================================================
HTML5 display definitions
========================================================================== */
/*
* Corrects block display not defined in IE6/7/8/9 & FF3
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section,
summary {
display: block;
}
/*
* Corrects inline-block display not defined in IE6/7/8/9 & FF3
*/
audio,
canvas,
video {
display: inline-block;
*display: inline;
*zoom: 1;
}
/*
* Prevents modern browsers from displaying 'audio' without controls
*/
audio:not([controls]) {
display: none;
}
/*
* Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4
* Known issue: no IE6 support
*/
[hidden] {
display: none;
}
/* =============================================================================
Base
========================================================================== */
/*
* 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units
* http://clagnut.com/blog/348/#c790
* 2. Prevents iOS text size adjust after orientation change, without disabling user zoom
* www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/
*/
html {
font-size: 100%;
/* 1 */
-webkit-text-size-adjust: 100%;
/* 2 */
-ms-text-size-adjust: 100%;
/* 2 */
}
/*
* Addresses font-family inconsistency between 'textarea' and other form elements.
*/
html,
button,
input,
select,
textarea {
font-family: sans-serif;
}
/*
* Addresses margins handled incorrectly in IE6/7
*/
body {
margin: 0;
}
/* =============================================================================
Links
========================================================================== */
/*
* Addresses outline displayed oddly in Chrome
*/
a:focus {
outline: thin dotted;
}
/*
* Improves readability when focused and also mouse hovered in all browsers
* people.opera.com/patrickl/experiments/keyboard/test
*/
a:hover,
a:active {
outline: 0;
}
/* =============================================================================
Typography
========================================================================== */
/*
* Addresses font sizes and margins set differently in IE6/7
* Addresses font sizes within 'section' and 'article' in FF4+, Chrome, S5
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
h2 {
font-size: 1.5em;
margin: 0.83em 0;
}
h3 {
font-size: 1.17em;
margin: 1em 0;
}
h4 {
font-size: 1em;
margin: 1.33em 0;
}
h5 {
font-size: 0.83em;
margin: 1.67em 0;
}
h6 {
font-size: 0.75em;
margin: 2.33em 0;
}
/*
* Addresses styling not present in IE7/8/9, S5, Chrome
*/
abbr[title] {
border-bottom: 1px dotted;
}
/*
* Addresses style set to 'bolder' in FF3+, S4/5, Chrome
*/
b,
strong {
font-weight: bold;
}
blockquote {
margin: 1em 40px;
}
/*
* Addresses styling not present in S5, Chrome
*/
dfn {
font-style: italic;
}
/*
* Addresses styling not present in IE6/7/8/9
*/
mark {
background: #ff0;
color: #000;
}
/*
* Addresses margins set differently in IE6/7
*/
p,
pre {
margin: 1em 0;
}
/*
* Corrects font family set oddly in IE6, S4/5, Chrome
* en.wikipedia.org/wiki/User:Davidgothberg/Test59
*/
pre,
code,
kbd,
samp {
font-family: monospace, serif;
_font-family: 'courier new', monospace;
font-size: 1em;
}
/*
* 1. Addresses CSS quotes not supported in IE6/7
* 2. Addresses quote property not supported in S4
*/
/* 1 */
q {
quotes: none;
}
/* 2 */
q:before,
q:after {
content: '';
content: none;
}
small {
font-size: 75%;
}
/*
* Prevents sub and sup affecting line-height in all browsers
* gist.github.com/413930
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* =============================================================================
Lists
========================================================================== */
/*
* Addresses margins set differently in IE6/7
*/
dl,
menu,
ol,
ul {
margin: 1em 0;
}
dd {
margin: 0 0 0 40px;
}
/*
* Addresses paddings set differently in IE6/7
*/
menu,
ol,
ul {
padding: 0 0 0 40px;
}
/*
* Corrects list images handled incorrectly in IE7
*/
nav ul,
nav ol {
list-style: none;
list-style-image: none;
}
/* =============================================================================
Embedded content
========================================================================== */
/*
* 1. Removes border when inside 'a' element in IE6/7/8/9, FF3
* 2. Improves image quality when scaled in IE7
* code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
*/
img {
border: 0;
/* 1 */
-ms-interpolation-mode: bicubic;
/* 2 */
}
/*
* Corrects overflow displayed oddly in IE9
*/
svg:not(:root) {
overflow: hidden;
}
/* =============================================================================
Figures
========================================================================== */
/*
* Addresses margin not present in IE6/7/8/9, S5, O11
*/
figure {
margin: 0;
}
/* =============================================================================
Forms
========================================================================== */
/*
* Corrects margin displayed oddly in IE6/7
*/
form {
margin: 0;
}
/*
* Define consistent border, margin, and padding
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/*
* 1. Corrects color not being inherited in IE6/7/8/9
* 2. Corrects text not wrapping in FF3
* 3. Corrects alignment displayed oddly in IE6/7
*/
legend {
border: 0;
/* 1 */
padding: 0;
white-space: normal;
/* 2 */
*margin-left: -7px;
/* 3 */
}
/*
* 1. Corrects font size not being inherited in all browsers
* 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome
* 3. Improves appearance and consistency in all browsers
*/
button,
input,
select,
textarea {
font-size: 100%;
/* 1 */
margin: 0;
/* 2 */
vertical-align: baseline;
/* 3 */
*vertical-align: middle;
/* 3 */
}
/*
* Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet
*/
button,
input {
line-height: normal;
/* 1 */
}
/*
* 1. Improves usability and consistency of cursor style between image-type 'input' and others
* 2. Corrects inability to style clickable 'input' types in iOS
* 3. Removes inner spacing in IE7 without affecting normal text inputs
* Known issue: inner spacing remains in IE6
*/
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
cursor: pointer;
/* 1 */
-webkit-appearance: button;
/* 2 */
*overflow: visible;
/* 3 */
}
/*
* Re-set default cursor for disabled elements
*/
button[disabled],
input[disabled] {
cursor: default;
}
/*
* 1. Addresses box sizing set to content-box in IE8/9
* 2. Removes excess padding in IE8/9
* 3. Removes excess padding in IE7
Known issue: excess padding remains in IE6
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
/* 1 */
padding: 0;
/* 2 */
*height: 13px;
/* 3 */
*width: 13px;
/* 3 */
}
/*
* 1. Addresses appearance set to searchfield in S5, Chrome
* 2. Addresses box-sizing set to border-box in S5, Chrome (include -moz to future-proof)
*/
input[type="search"] {
-webkit-appearance: textfield;
/* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
/* 2 */
box-sizing: content-box;
}
/*
* Removes inner padding and search cancel button in S5, Chrome on OS X
*/
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
-webkit-appearance: none;
}
/*
* Removes inner padding and border in FF3+
* www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/*
* 1. Removes default vertical scrollbar in IE6/7/8/9
* 2. Improves readability and alignment in all browsers
*/
textarea {
overflow: auto;
/* 1 */
vertical-align: top;
/* 2 */
}
/* =============================================================================
Tables
========================================================================== */
/*
* Remove most spacing between table cells
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
.highlight .hll { background-color: #404040 }
.highlight { color: #d0d0d0 }
.highlight .c { color: #999999; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .g { color: #d0d0d0 } /* Generic */
.highlight .k { color: #6ab825; font-weight: normal } /* Keyword */
.highlight .l { color: #d0d0d0 } /* Literal */
.highlight .n { color: #d0d0d0 } /* Name */
.highlight .o { color: #d0d0d0 } /* Operator */
.highlight .x { color: #d0d0d0 } /* Other */
.highlight .p { color: #d0d0d0 } /* Punctuation */
.highlight .cm { color: #999999; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #cd2828; font-weight: normal } /* Comment.Preproc */
.highlight .c1 { color: #999999; font-style: italic } /* Comment.Single */
.highlight .cs { color: #e50808; font-weight: normal; background-color: #520000 } /* Comment.Special */
.highlight .gd { color: #d22323 } /* Generic.Deleted */
.highlight .ge { color: #d0d0d0; font-style: italic } /* Generic.Emph */
.highlight .gr { color: #d22323 } /* Generic.Error */
.highlight .gh { color: #ffffff; font-weight: normal } /* Generic.Heading */
.highlight .gi { color: #589819 } /* Generic.Inserted */
.highlight .go { color: #cccccc } /* Generic.Output */
.highlight .gp { color: #aaaaaa } /* Generic.Prompt */
.highlight .gs { color: #d0d0d0; font-weight: normal } /* Generic.Strong */
.highlight .gu { color: #ffffff; text-decoration: underline } /* Generic.Subheading */
.highlight .gt { color: #d22323 } /* Generic.Traceback */
.highlight .kc { color: #6ab825; font-weight: normal } /* Keyword.Constant */
.highlight .kd { color: #6ab825; font-weight: normal } /* Keyword.Declaration */
.highlight .kn { color: #6ab825; font-weight: normal } /* Keyword.Namespace */
.highlight .kp { color: #6ab825 } /* Keyword.Pseudo */
.highlight .kr { color: #6ab825; font-weight: normal } /* Keyword.Reserved */
.highlight .kt { color: #6ab825; font-weight: normal } /* Keyword.Type */
.highlight .ld { color: #d0d0d0 } /* Literal.Date */
.highlight .m { color: #3677a9 } /* Literal.Number */
.highlight .s { color: #9dd5f1 } /* Literal.String */
.highlight .na { color: #bbbbbb } /* Name.Attribute */
.highlight .nb { color: #24909d } /* Name.Builtin */
.highlight .nc { color: #447fcf; text-decoration: underline } /* Name.Class */
.highlight .no { color: #40ffff } /* Name.Constant */
.highlight .nd { color: #ffa500 } /* Name.Decorator */
.highlight .ni { color: #d0d0d0 } /* Name.Entity */
.highlight .ne { color: #bbbbbb } /* Name.Exception */
.highlight .nf { color: #447fcf } /* Name.Function */
.highlight .nl { color: #d0d0d0 } /* Name.Label */
.highlight .nn { color: #447fcf; text-decoration: underline } /* Name.Namespace */
.highlight .nx { color: #d0d0d0 } /* Name.Other */
.highlight .py { color: #d0d0d0 } /* Name.Property */
.highlight .nt { color: #6ab825;} /* Name.Tag */
.highlight .nv { color: #40ffff } /* Name.Variable */
.highlight .ow { color: #6ab825; font-weight: normal } /* Operator.Word */
.highlight .w { color: #666666 } /* Text.Whitespace */
.highlight .mf { color: #3677a9 } /* Literal.Number.Float */
.highlight .mh { color: #3677a9 } /* Literal.Number.Hex */
.highlight .mi { color: #3677a9 } /* Literal.Number.Integer */
.highlight .mo { color: #3677a9 } /* Literal.Number.Oct */
.highlight .sb { color: #9dd5f1 } /* Literal.String.Backtick */
.highlight .sc { color: #9dd5f1 } /* Literal.String.Char */
.highlight .sd { color: #9dd5f1 } /* Literal.String.Doc */
.highlight .s2 { color: #9dd5f1 } /* Literal.String.Double */
.highlight .se { color: #9dd5f1 } /* Literal.String.Escape */
.highlight .sh { color: #9dd5f1 } /* Literal.String.Heredoc */
.highlight .si { color: #9dd5f1 } /* Literal.String.Interpol */
.highlight .sx { color: #ffa500 } /* Literal.String.Other */
.highlight .sr { color: #9dd5f1 } /* Literal.String.Regex */
.highlight .s1 { color: #9dd5f1 } /* Literal.String.Single */
.highlight .ss { color: #9dd5f1 } /* Literal.String.Symbol */
.highlight .bp { color: #24909d } /* Name.Builtin.Pseudo */
.highlight .vc { color: #40ffff } /* Name.Variable.Class */
.highlight .vg { color: #40ffff } /* Name.Variable.Global */
.highlight .vi { color: #40ffff } /* Name.Variable.Instance */
.highlight .il { color: #3677a9 } /* Literal.Number.Integer.Long */
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment