Skip to content

Commit c03b2c1

Browse files
authored
Merge pull request #616 from muflihun/develop
potential wrapper for mutex
2 parents e9dc1ec + 2ca71dd commit c03b2c1

File tree

5 files changed

+73
-8
lines changed

5 files changed

+73
-8
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ release.info
66
bin/*
77
logs/*
88
experiments/*
9-
CMakeLists.txt.user
9+
CMakeLists.txt.user*

.travis.yml

+51-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,55 @@
11
language: cpp
2-
compiler:
3-
- gcc
4-
os: linux
5-
dist: trusty
2+
matrix:
3+
include:
4+
- os: linux
5+
dist: trusty
6+
compiler: clang
7+
- os: linux
8+
dist: trusty
9+
compiler: gcc
10+
env:
11+
- COMPILER=g++-4.8
12+
addons:
13+
apt:
14+
sources: ['ubuntu-toolchain-r-test']
15+
packages: [g++-4.8, valgrind]
16+
- os: linux
17+
dist: trusty
18+
compiler: gcc
19+
env:
20+
- COMPILER=g++-4.9
21+
addons:
22+
apt:
23+
sources: ['ubuntu-toolchain-r-test']
24+
packages: [g++-4.9, valgrind]
25+
- os: linux
26+
dist: trusty
27+
compiler: gcc
28+
env:
29+
- COMPILER=g++-5
30+
addons:
31+
apt:
32+
sources: ['ubuntu-toolchain-r-test']
33+
packages: [g++-5, valgrind]
34+
- os: linux
35+
dist: trusty
36+
compiler: gcc
37+
env:
38+
- COMPILER=g++-6
39+
addons:
40+
apt:
41+
sources: ['ubuntu-toolchain-r-test']
42+
packages: [g++-6, valgrind]
43+
- os: linux
44+
dist: trusty
45+
compiler: gcc
46+
env:
47+
- COMPILER=g++-7
48+
addons:
49+
apt:
50+
sources: ['ubuntu-toolchain-r-test']
51+
packages: [g++-7, valgrind]
52+
653
before_install:
754
- sudo apt-get -qq update
855
- sudo apt-get install -y libgtest-dev valgrind cmake

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
<a href="#submitting-patches">Submitting Patches</a>
9494
<a href="#reporting-a-bug">Reporting a Bug</a>
9595
<a href="#compatibility">Compatibility</a>
96+
<a href="#build-matrix">Build Matrix</a>
9697
<a href="#licence">Licence</a>
9798
<a href="#disclaimer">Disclaimer</a>
9899
</pre>
@@ -1437,6 +1438,23 @@ Easylogging++ has also been tested with following C++ libraries;
14371438

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

1441+
## Build Matrix
1442+
1443+
| Branch | Platform | Build Status |
1444+
| -------- |:------------:|:------------:|
1445+
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `clang++` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/develop/1)](https://travis-ci.org/muflihun/easyloggingpp) |
1446+
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-4.9` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/develop/2)](https://travis-ci.org/muflihun/easyloggingpp) |
1447+
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-5` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/develop/3)](https://travis-ci.org/muflihun/easyloggingpp) |
1448+
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-6` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/develop/4)](https://travis-ci.org/muflihun/easyloggingpp) |
1449+
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-7` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/develop/5)](https://travis-ci.org/muflihun/easyloggingpp) |
1450+
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `clang++` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/master/1)](https://travis-ci.org/muflihun/easyloggingpp) |
1451+
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-4.9` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/master/2)](https://travis-ci.org/muflihun/easyloggingpp) |
1452+
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-5` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/master/3)](https://travis-ci.org/muflihun/easyloggingpp) |
1453+
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-6` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/master/4)](https://travis-ci.org/muflihun/easyloggingpp) |
1454+
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-7` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/master/5)](https://travis-ci.org/muflihun/easyloggingpp) |
1455+
1456+
[![top] Goto Top](#table-of-contents)
1457+
14401458
# Licence
14411459
```
14421460
The MIT License (MIT)

samples/STL/multi-loggers-to-same-file.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
INITIALIZE_EASYLOGGINGPP
1111

1212
void def() {
13-
for (int i = 0; i < 10000; ++i)
13+
for (int i = 0; i < 1000; ++i)
1414
CLOG(INFO, "first") << "This is from first " << i;
1515
}
1616

1717
void second() {
18-
for (int i = 0; i < 10000; ++i)
18+
for (int i = 0; i < 1000; ++i)
1919
CLOG(INFO, "second") << "This is from second" << i;
2020
}
2121

src/easylogging++.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2105,7 +2105,7 @@ void LogDispatchCallback::handle(const LogDispatchData* data) {
21052105
std::string filename = data->logMessage()->logger()->typedConfigurations()->filename(data->logMessage()->level());
21062106
auto lock = m_fileLocks.find(filename);
21072107
if (lock == m_fileLocks.end()) {
2108-
m_fileLocks.emplace(std::make_pair(filename, new base::threading::Mutex));
2108+
m_fileLocks.emplace(std::make_pair(filename, std::unique_ptr<base::threading::Mutex>(new base::threading::Mutex)));
21092109
}
21102110
#endif
21112111
}

0 commit comments

Comments
 (0)