I'm using boost 1.63 for logging with the following line of code to use Boost config file for logging:
Logger::initFromConfig(logConfigName);
I decided so because I want it to be configurable and this way I could save myself from understanding Boost log setup API. Config file contents are:
[Core]
DisableLogging="false"
[Sinks.SYSLF]
Destination="TextFile"
Asynchronous="true"
AutoFlush="true"
Format="[%TimeStamp(format=\"%Y-%m-%d %H:%M:%S.%f\")%][%Severity%] %Message%"
Target="logs"
FileName="dsmip_%N.log"
RotationTimePoint="00:00:00"
ScanForFiles="Matching"
MaxSize="10000000"
Filter="%Severity% >= info"
[Sinks.Console]
Destination="Console"
AutoFlush="true"
Format="[%TimeStamp(format=\"%Y-%m-%d %H:%M:%S.%f\")%][%Severity%] %Message%"
Filter="%Severity% >= debug"
My problem is autoflush does not work for files. On stdout I get every event instantly, but the files are written first when I exit the application. This is quite embarassing for logging...
First I used 1.58, the situation was the same. What do I do wrong?
Thank you in advance.
Best regards: Balazs Bamer
Google was my friend, I have found the solution here. Boost really operates such that it creates the log file in the application directory, and only copies it to the destination when it is closed (log rotates or the program exists). So, in order to get all the log files appear in a specific directory, one has to include the directory name in the filename pattern as well as in the target.
[Sinks.SYSLF]
...
Target="logs"
FileName="logs/dsmip_%N.log"
Best regards: Balazs
Related
VS2017, SDK/WDK, C++ project
we have a c++ solution (driver) that is shared across developers via Team Foundation Services - visualstudio.com (now called azure devops?).
When I perform a get latest source code, and want to rebuild the solution I get two MSB3030 errors:
"Could not copy the file "C:\path of my colleague his file" because it was not found."
I found it strange that I saw on one of the two errors a path of my colleague his pc. He works on C:\ I'm working on E:\
Unloading the project, I saw he path being set here:
<ItemGroup>
<FilesToPackage Include="C:\path of my colleague\foo.xml" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PackageRelativeDirectory>
</PackageRelativeDirectory>
</FilesToPackage>
We cannot get this solution to build because of the MSB3030. First we have to clean the specific projects individually, rebuild it, then build another project etc.. a few steps to perform manually in the correct order , trial and error, drinking coffee, throwing bananas to the pc and praying that a monkey outputs the code correctly.
Has anyone seen somehting similar regarding MSB3030 errors?
On my pc I see the path of my colleague, but he doesn't see my path (strange!).
C:\Program Files (x86)\Windows
Kits\10\build\WindowsDriver.common.targets(1699,5): error MSB3030:
Could not copy the file 'C:...' because it was not found.
I've set the Any CPU to x64 because it doesn't make any sense for c++.
C++ Windows Driver MSB3030 could not copy the file '' because it was not found
The reason for this issue is that the path of the ItemGroup is an absolute path in the project file:
<ItemGroup>
<FilesToPackage Include="C:\path of my colleague\foo.xml" ...>
...
</FilesToPackage>
</ItemGroup>
Regardless of whether your colleague has added this file to source control, when you pull the code from the TFS server to your local and put the code in a different local folder, the absolute path will bring you a lot of trouble, you need to manually check the code on the TFS server for this file and you need to modify the absolute path of this file in your project. But this problem will reappear after your colleague updates after you submit your code. Because an absolute path cannot be assigned to two different paths C:\ and E:\.
To resolve this issue, you need to change the absolute path to a relative path in the source code. Generally, we prefer to add this file to the Solution/Project folder, then use the MSBuild Macros $(SolutionDir)/$(ProjectDir) to specify it.
Check Common macros for build commands and properties for some more details.
Hope this helps.
I have installed veins-4.5 and I can run the Erlangen example.
However, when I try to run the example in the subprojects/veins_inet folder it gives "Error: Network 'Scenario' not found, check .ini and .ned files"
However the Scenario.ned is in the same folder as omnetp.ini.
How do I solve this problem?
Many thanks.
If you are using the interface graphic, do it: click in subprojects/veins_inet and next in omnet ++ project -> build all.
Another cause for that error is that the .ini isn't correct.
In particular, if you wish to simulate using Gui (Tkenv), your .ini file should include something like:
[Config MyNetwork]
However, for a command-line simulation (Cmdenv), the .ini file should read instead:
cmdenv-config-name = MyNetwork
in the latter case, you should also add "-u Cmdenv" to your run command.
Confusing between the 2 options above raises the error ""Error: Network '...' not found, check .ini and .ned files".
I have a bucket with more than ten thousand files. I am getting the following error while doing 'ls -l' folder but working fine for less than 1000 files in the folder. Any suggestions?
ls: reading directory ./: Input/output error
I notice that each listing of a file in folder makes an http call to S3, any chance this # can be increased?
Thanks!
I would like to recommend to take a look at the new project RioFS (Userspace S3 filesystem): https://github.com/skoobe/riofs.
This project is “s3fs” alternative, the main advantages comparing to “s3fs” are: simplicity, the speed of operations and bugs-free code. Currently the project is in the “testing” state, but it's been running on several high-loaded fileservers for quite some time.
We are seeking for more people to join our project and help with the testing. From our side we offer quick bugs fix and will listen to your requests to add new features.
RioFS should work fine with such great number of files per directory, but please try to increase the directory caching timeout in the configuration file (see dir_cache_max_time description in riofs.conf.xml)
Hope it helps you and we are looking forward to seeing you joined our community !
i just installed YouCompleteMe for Vim through vundle. It works, but it shows only the words contained in the current file. I want to use it to develop c++ programs, how can i configure it to show autocompletion from c++ headers file in /usr/include for example? Thanks a lot.
You need to navigate to ~/.vim/bundles/YouCompleteMe and run the installation script with --clang-completer, so do ./install.sh --clang-completer. After it finishes you should have support for C like languages.
You may also need to place let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py' in your ~/.vimrc.
I have installed with pathogen. I tried the above instructions with ./install.sh --clang-complete. After this, it did not work, and I indeed had to add the path. But it was different than in another reply here, namely
let g:ycm_global_ycm_extra_conf = '.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
so there is an extra "third_party/ycmd" in the path.
While the suggestions here might work in the beginning, I am not sure it's the proper way to go. According to YCM developer, whenever you start a project, you need a new .ycm_extra_conf.py file
From https://valloric.github.io/YouCompleteMe/#ubuntu-linux-x64-super-quick-installation
YCM looks for a .ycm_extra_conf.py file in the directory of the opened file or in any directory above it in the hierarchy (recursively); when the file is found, it is loaded (only once!) as a Python module. YCM calls a FlagsForFile method in that module which should provide it with the information necessary to compile the current file. You can also provide a path to a global .ycm_extra_conf.py file, which will be used as a fallback. To prevent the execution of malicious code from a file you didn't write YCM will ask you once per .ycm_extra_conf.py if it is safe to load. This can be disabled and you can white-/blacklist files. See the Options section for more details.
While you might only need to modify the compile flags from the vanilla .ycm_extra_conf.py, I feel it is advisable to create a new file for every project you start.
Everything that the folks here have said is correct. I just want to add that as of 2017, the "install.sh" script is deprecated. Now, you have to use the install.py script instead by typing
./install.py --clang-completer
Also, in your .vimrc file, instead of ".vim/bundle/blahblahblah", you'll need to add a "~/" in front of the address by adding:
let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py"
to your .vimrc file, to give it an absolute path from the Home directory so that Vim can find the ".ycm_extra_conf.py" file. Otherwise, you might experience some funny behavior.
I just wanted to add if you don't want to manually define a config file there is this neat little repository that will auto generate it. https://github.com/rdnetto/YCM-Generator
In the "Excluded Regions" of the CVS configuration, I have added the following:
.*/.*/.*\.d
.*/.*/.*\.o
.*/.*/.*\.so
.*/.*/.*\.a
.*/.*/.*\.exe
.*/.*/.*\.obj
.*/.*/.*\.dll
.*/.*/.*\.lib
.*/.*/.*\.txt
.*/.*/.*\.tar
.*/.*/.*\.tar\.gz
All files with the above extensions should be ignored. However, Jenkins still runs builds based on the fact that a file "build.txt" in some folder ABC has changed, or the one of the tar.gz files has changed. How to get Jenkins to ignore these files? Is something wrong with my regex?
Glad that worked for you! Reposting as requested:
My guess is it has to do with the .*/ parts. Have you tried it with just .*\.txt?
Just as an experiment, you might also try /.*/.*/.*\.txt (note the extra / at the beginning). I have a feeling the problem was related to using relative vs. absolute file paths.