Skip to content

Commit

Permalink
Merge pull request #506 from muflihun/develop
Browse files Browse the repository at this point in the history
v9.94.1 release
  • Loading branch information
abumq authored Feb 24, 2017
2 parents df07724 + 5b6678a commit a5c364a
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 46 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

## [9.94.1] - 25-02-2017
### Fixed
- Fixes for `/W4` level warnings generated in MSVC compile (Thanks to [Falconne](https://github.com/Falconne))
- Fixed links
- Fixes removing default logger if other than `default`

### Changes
- Changed documentation to mention `easylogging++.cc` in introduction and added links to features

## [9.94.0] - 14-02-2017
### Fixed
- Fixed performance tracking time unit and calculations
Expand All @@ -10,4 +19,4 @@
- Custom format specifier now has to return `std::string` instead
- Merged `thread_name` with `thread` if thread name is available it's used otherwise ID is displayed

For older versions please refer to https://github.com/muflihun/easyloggingpp/tree/master/doc
For older versions please refer to [https://github.com/muflihun/easyloggingpp/tree/master/doc](https://github.com/muflihun/easyloggingpp/tree/master/doc)
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ project(Easyloggingpp CXX)
option(test "Build all tests" OFF)

set(ELPP_MAJOR_VERSION "9")
set(ELPP_MINOR_VERSION "93")
set(ELPP_PATCH_VERSION "0")
set(ELPP_MINOR_VERSION "94")
set(ELPP_PATCH_VERSION "1")
set(ELPP_VERSION_STRING "${ELPP_MAJOR_VERSION}.${ELPP_MINOR_VERSION}.${ELPP_PATCH_VERSION}")

set(ELPP_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The directory the headers are installed in")
Expand Down
2 changes: 1 addition & 1 deletion LICENCE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ The MIT License (MIT)
Copyright (c) 2017 muflihun.com

https://github.com/muflihun/
https://labs.muflihun.com
https://muflihun.github.io
https://muflihun.com

Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
47 changes: 29 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@

![banner]

> **Manual For v9.94.0**
> **Manual For v9.94.1**
[![Build Status (Develop)](https://img.shields.io/travis/muflihun/easyloggingpp/develop.svg)](https://travis-ci.org/muflihun/easyloggingpp) (`develop`)

[![Build Status (Master)](https://img.shields.io/travis/muflihun/easyloggingpp/master.svg)](https://travis-ci.org/muflihun/easyloggingpp) (`master`)

[![Version](https://img.shields.io/github/release/muflihun/easyloggingpp.svg)](https://github.com/muflihun/easyloggingpp/releases/latest)

[![Canon.io](https://img.shields.io/badge/conan.io-easyloggingpp%2F9.94.0-green.svg?logo=data:image/png;base64%2CiVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAMAAAAolt3jAAAA1VBMVEUAAABhlctjlstkl8tlmMtlmMxlmcxmmcxnmsxpnMxpnM1qnc1sn85voM91oM11oc1xotB2oc56pNF6pNJ2ptJ8ptJ8ptN9ptN8p9N5qNJ9p9N9p9R8qtOBqdSAqtOAqtR%2BrNSCrNJ/rdWDrNWCsNWCsNaJs9eLs9iRvNuVvdyVv9yXwd2Zwt6axN6dxt%2Bfx%2BChyeGiyuGjyuCjyuGly%2BGlzOKmzOGozuKoz%2BKqz%2BOq0OOv1OWw1OWw1eWx1eWy1uay1%2Baz1%2Baz1%2Bez2Oe02Oe12ee22ujUGwH3AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfgBQkREyOxFIh/AAAAiklEQVQI12NgAAMbOwY4sLZ2NtQ1coVKWNvoc/Eq8XDr2wB5Ig62ekza9vaOqpK2TpoMzOxaFtwqZua2Bm4makIM7OzMAjoaCqYuxooSUqJALjs7o4yVpbowvzSUy87KqSwmxQfnsrPISyFzWeWAXCkpMaBVIC4bmCsOdgiUKwh3JojLgAQ4ZCE0AMm2D29tZwe6AAAAAElFTkSuQmCC)](http://www.conan.io/source/easyloggingpp/9.94.0/memsharded/testing)

[![Try online](https://img.shields.io/badge/try-online-blue.svg)](http://melpon.org/wandbox/permlink/rwDXGcnP1IoCKXrJ)

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/muflihun/easyloggingpp/blob/master/LICENCE)

[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/MuflihunDotCom/25)

[![Downloads](https://img.shields.io/github/downloads/muflihun/easyloggingpp/total.svg)](https://github.com/muflihun/easyloggingpp/releases/latest)
Expand Down Expand Up @@ -100,34 +106,39 @@
</pre>

# Introduction
Easylogging++ is single header, feature-rich, efficient logging library for C++ applications. It has been written keeping three things in mind: performance, management (setup, configure, logging, simplicity) and portability. Its highly configurable and extremely useful for small to large sized projects.
This manual is for Easylogging++ v9.94.0. For other versions please refer to corresponding [release](https://github.com/muflihun/easyloggingpp/releases) on github.
Easylogging++ is single header efficient logging library for C++ applications. It is extremely powerful, highly extendable and configurable to user's requirements. It provides ability to [write your own sinks](https://github.com/muflihun/easyloggingpp/tree/master/samples/send-to-network) (referred to as `LogDispatchCallback`). Currently used by hundreds of open-source projects.

This manual is for Easylogging++ v9.94.1. For other versions please refer to corresponding [release](https://github.com/muflihun/easyloggingpp/releases) on github.

[![top] Goto Top](#table-of-contents)

### Why yet another library
If you are working on a small utility or large project in C++, this library can be handy. Its based on single header and does not require linking or installation. You can import into your project as if its part of your project. This library has been designed with various thoughts in mind (i.e, portability, performance, usability, features and easy to setup).
If you are working on a small utility or large project in C++, this library can be handy. Its based on single header and only requires to link to single source file. (Originally it was header-only and was changed to use source file in [issue #445](https://github.com/muflihun/easyloggingpp/issues/445). You can still use header-only in [v9.89](https://github.com/muflihun/easyloggingpp/releases/tag/9.89)).

This library has been designed with various thoughts in mind (i.e, portability, performance, usability, features and easy to setup).

Why yet another library? Well, answer is pretty straight forward, use it as if you wrote it so you can fix issues (if any) as you go or raise them on github. In addition to that, I have not seen any logging library based on single-header with such a design where you can configure on the go and get the same performance. I have seen other single-header logging libraries for C++ but either they use external libraries, e.g, boost, Qt to support certain features like threading, regular expression or date etc. This library has everything built-in to prevent usage of external libraries, not that I don't like those libraries, in fact I love them, but because not all projects use these libraries, I couldn't take risk of depending on them.
Why yet another library? Well, answer is pretty straight forward, use it as you wrote it so you can fix issues (if any) as you go or raise them on github. In addition to that, I personally have not seen any logging library based on single-header with such a design where you can configure on the go, extend it to your needs and get fast performance. I have seen other single-header logging libraries for C++ but either they use external libraries, e.g, boost or Qt to support certain features like threading, regular expression or date etc. This library has everything built-in to prevent usage of external libraries, not that I don't like those libraries, in fact I love them, but because not all projects use these libraries, I couldn't take risk of depending on them.

[![top] Goto Top](#table-of-contents)

### Features at a glance
Easylogging++ is feature-rich containing many features that both typical and advanced developer will require while writing a software;
* Highly configurable
* [Highly configurable](#configuration)
* [Extendable](#log-dispatch-callback)
* Extremely fast
* Thread and type safe
* Cross-platform
* Custom log patterns
* Conditional and occasional logging
* Performance tracking
* Verbose logging
* Crash handling
* Helper CHECK macros
* STL logging
* Third-party library logging (Qt, boost, wxWidgets etc)
* Extensible (Logging your own class or third-party class)
* And many more...
* [Thread](#multi-threading) and type safe
* [Cross-platform](#compatibility)
* [Custom log patterns](#logging-format-specifiers)
* [Conditional and occasional logging](#conditional-logging)
* [Performance tracking](#performance-tracking)
* [Verbose logging](#verbose-logging]
* [Crash handling](#crash-handling)
* [Helper CHECK macros](#check-macros)
* [STL logging](#stl-logging)
* [Send to Syslog](#syslog)
* [Third-party library logging (Qt, boost, wxWidgets etc)](#logging-third-party-class)
* [Extensible (Logging your own class or third-party class)](#logging-your-own-class)
* [And many more...](#extra-features)

[![top] Goto Top](#table-of-contents)

Expand Down
26 changes: 13 additions & 13 deletions src/easylogging++.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Bismillah ar-Rahmaan ar-Raheem
//
// Easylogging++ v9.94.0
// Easylogging++ v9.94.1
// Cross-platform logging library for C++ applications
//
// Copyright (c) 2017 muflihun.com
Expand All @@ -10,7 +10,7 @@
// http://labs.muflihun.com/easyloggingpp/licence.php
//
// https://github.com/muflihun/easyloggingpp
// http://labs.muflihun.com/easyloggingpp
// https://muflihun.github.io/easyloggingpp
// http://muflihun.com
//

Expand Down Expand Up @@ -208,7 +208,7 @@ bool Configurations::parseFromFile(const std::string& configurationFile, Configu
// We initial assertion with true because if we have assertion diabled, we want to pass this
// check and if assertion is enabled we will have values re-assigned any way.
bool assertionPassed = true;
ELPP_ASSERT((assertionPassed = base::utils::File::pathExists(configurationFile.c_str(), true)),
ELPP_ASSERT((assertionPassed = base::utils::File::pathExists(configurationFile.c_str(), true)) == true,
"Configuration file [" << configurationFile << "] does not exist!");
if (!assertionPassed) {
return false;
Expand Down Expand Up @@ -1116,7 +1116,7 @@ base::type::string_t DateTime::formatTime(unsigned long long time, base::Timesta
if (base::consts::kTimeFormats[i].value == 1000.0f && time / 1000.0f < 1.9f) {
break;
}
time /= base::consts::kTimeFormats[i].value;
time /= static_cast<decltype(time)>(base::consts::kTimeFormats[i].value);
unit = base::consts::kTimeFormats[i + 1].unit;
}
base::type::stringstream_t ss;
Expand Down Expand Up @@ -1727,7 +1727,7 @@ void TypedConfigurations::insertFile(Level level, const std::string& fullFilenam
create(m_filenameMap.empty() && m_fileStreamMap.empty() ? Level::Global : level);
}

bool TypedConfigurations::unsafeValidateFileRolling(Level level, const PreRollOutCallback& PreRollOutCallback) {
bool TypedConfigurations::unsafeValidateFileRolling(Level level, const PreRollOutCallback& preRollOutCallback) {
base::type::fstream_t* fs = unsafeGetConfigByRef(level, &m_fileStreamMap, "fileStream").get();
if (fs == nullptr) {
return true;
Expand All @@ -1739,7 +1739,7 @@ bool TypedConfigurations::unsafeValidateFileRolling(Level level, const PreRollOu
ELPP_INTERNAL_INFO(1, "Truncating log file [" << fname << "] as a result of configurations for level ["
<< LevelHelper::convertToString(level) << "]");
fs->close();
PreRollOutCallback(fname.c_str(), currFileSize);
preRollOutCallback(fname.c_str(), currFileSize);
fs->open(fname, std::fstream::out | std::fstream::trunc);
return true;
}
Expand Down Expand Up @@ -1823,7 +1823,7 @@ Logger* RegisteredLoggers::get(const std::string& id, bool forceCreation) {
}

bool RegisteredLoggers::remove(const std::string& id) {
if (id == "default") {
if (id == base::consts::kDefaultLoggerId) {
return false;
}
Logger* logger = base::utils::Registry<Logger, std::string>::get(id);
Expand Down Expand Up @@ -1907,7 +1907,7 @@ void VRegistry::setModules(const char* modules) {
isLevel = false;
isMod = true;
if (!ss.str().empty() && level != -1) {
insert(ss, level);
insert(ss, static_cast<base::type::VerboseLevel>(level));
ss.str(std::string(""));
level = -1;
}
Expand All @@ -1924,7 +1924,7 @@ void VRegistry::setModules(const char* modules) {
}
}
if (!ss.str().empty() && level != -1) {
insert(ss, level);
insert(ss, static_cast<base::type::VerboseLevel>(level));
}
}

Expand All @@ -1951,9 +1951,9 @@ void VRegistry::setFromArgs(const base::utils::CommandLineArgs* commandLineArgs)
commandLineArgs->hasParam("-V") || commandLineArgs->hasParam("--VERBOSE")) {
setLevel(base::consts::kMaxVerboseLevel);
} else if (commandLineArgs->hasParamWithValue("--v")) {
setLevel(atoi(commandLineArgs->getParamValue("--v")));
setLevel(static_cast<base::type::VerboseLevel>(atoi(commandLineArgs->getParamValue("--v"))));
} else if (commandLineArgs->hasParamWithValue("--V")) {
setLevel(atoi(commandLineArgs->getParamValue("--V")));
setLevel(static_cast<base::type::VerboseLevel>(atoi(commandLineArgs->getParamValue("--V"))));
} else if ((commandLineArgs->hasParamWithValue("-vmodule")) && vModulesEnabled()) {
setModules(commandLineArgs->getParamValue("-vmodule"));
} else if (commandLineArgs->hasParamWithValue("-VMODULE") && vModulesEnabled()) {
Expand Down Expand Up @@ -2969,11 +2969,11 @@ void Loggers::clearVModules(void) {
// VersionInfo

const std::string VersionInfo::version(void) {
return std::string("9.94.0");
return std::string("9.94.1");
}
/// @brief Release date of current version
const std::string VersionInfo::releaseDate(void) {
return std::string("14-02-2017 0946hrs");
return std::string("25-02-2017 0813hrs");
}

} // namespace el
12 changes: 6 additions & 6 deletions src/easylogging++.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Bismillah ar-Rahmaan ar-Raheem
//
// Easylogging++ v9.94.0
// Easylogging++ v9.94.1
// Single-header only, cross-platform logging library for C++ applications
//
// Copyright (c) 2017 muflihun.com
Expand All @@ -10,7 +10,7 @@
// http://labs.muflihun.com/easyloggingpp/licence.php
//
// https://github.com/muflihun/easyloggingpp
// http://labs.muflihun.com/easyloggingpp
// https://muflihun.github.io/easyloggingpp
// http://muflihun.com
//
#ifndef EASYLOGGINGPP_H
Expand Down Expand Up @@ -1944,7 +1944,7 @@ class TypedConfigurations : public base::threading::ThreadSafe {

TypedConfigurations(const TypedConfigurations& other);

~TypedConfigurations(void) {
virtual ~TypedConfigurations(void) {
}

const Configurations* configurations(void) const {
Expand Down Expand Up @@ -2055,11 +2055,11 @@ class TypedConfigurations : public base::threading::ThreadSafe {
unsigned long getULong(std::string confVal);
std::string resolveFilename(const std::string& filename);
void insertFile(Level level, const std::string& fullFilename);
bool unsafeValidateFileRolling(Level level, const PreRollOutCallback& PreRollOutCallback);
bool unsafeValidateFileRolling(Level level, const PreRollOutCallback& preRollOutCallback);

inline bool validateFileRolling(Level level, const PreRollOutCallback& PreRollOutCallback) {
inline bool validateFileRolling(Level level, const PreRollOutCallback& preRollOutCallback) {
base::threading::ScopedLock scopedLock(lock());
return unsafeValidateFileRolling(level, PreRollOutCallback);
return unsafeValidateFileRolling(level, preRollOutCallback);
}
};
/// @brief Class that keeps record of current line hit for occasional logging
Expand Down
8 changes: 3 additions & 5 deletions tools/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ if [ "$confirm" = "y" ]; then
if [ -f "$1/src/easylogging++.cc.orig" ];then
rm $1/src/easylogging++.cc.orig
fi
sed -i '' -e "s/\$currentVersion = \"$CURR_VERSION\"*/\$currentVersion = \"$NEW_VERSION\"/g" $2/version.php
sed -i '' -e "s/\$releaseDate = \"$CURR_RELEASE_DATE\"*/\$releaseDate = \"$NEW_RELEASE_DATE\"/g" $2/version.php
sed -i '' -e "s/$CURR_RELEASE_DATE/$NEW_RELEASE_DATE/g" $2/version.php
sed -i '' -e "s/$CURR_VERSION ($CURR_RELEASE_DATE)/$NEW_VERSION ($NEW_RELEASE_DATE)/g" $2/index.html
sed -i '' -e "s/v$CURR_VERSION/v$NEW_VERSION/g" $1/README.md
sed -i '' -e "s/easyloggingpp_$CURR_VERSION.zip/easyloggingpp_$NEW_VERSION.zip/g" $1/README.md
if [ -f "easyloggingpp_v$NEW_VERSION.zip" ]; then
Expand All @@ -74,8 +72,8 @@ if [ "$confirm" = "y" ]; then
cp $1/LICENCE LICENCE.txt
zip easyloggingpp_v$NEW_VERSION.zip easylogging++.h easylogging++.cc LICENCE.txt CHANGELOG.txt
tar -pczf easyloggingpp_v$NEW_VERSION.tar.gz easylogging++.h easylogging++.cc LICENCE.txt CHANGELOG.txt
mv easyloggingpp_v$NEW_VERSION.zip $2/releases/
mv easyloggingpp_v$NEW_VERSION.tar.gz $2/releases/
mv easyloggingpp_v$NEW_VERSION.zip $2/
mv easyloggingpp_v$NEW_VERSION.tar.gz $2/
rm easylogging++.h easylogging++.cc CHANGELOG.txt LICENCE.txt
echo "\n---------- PLEASE CHANGE CMakeLists.txt MANUALLY ----------- \n"
fi

0 comments on commit a5c364a

Please sign in to comment.