File: devnull-log

package info (click to toggle)
librcsb-core-wrapper 1.005-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 16,504 kB
  • sloc: xml: 122,915; cpp: 25,250; ansic: 3,736; makefile: 1,031; sh: 772; lex: 294; yacc: 235; perl: 213; python: 121; csh: 30
file content (30 lines) | stat: -rw-r--r-- 1,522 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Author: Laszlo Kajan <lkajan@rostlab.org>
Description: do not attempt to remove log file when it is "/dev/null"
 Silencing logging is only possible by setting the log file to "/dev/null",
 but there is an error when it tries to remove this file, and it can not.
 This patch checks the log file name, and "/dev/null" is not removed.
Forwarded: http://lists.alioth.debian.org/pipermail/debian-med-packaging/2012-September/017173.html
--- a/cif-parser/include/CifParserBase.h
+++ b/cif-parser/include/CifParserBase.h
@@ -73,7 +73,9 @@ class CifParser : public CifScanner
         **  \param[in] fileName - relative or absolute name of the CIF file
         **    that is to be parsed.
         **  \param[in] parseLogFileName - relative or absolute name of the file
-        **    where parsing log is to be stored.
+        **    where parsing log is to be stored. Defaults to
+        **    "<input-file>-parser.log" if left empty.
+        **    Use "/dev/null" to disable logging.
         **  \param[out] diagnostics - parsing result. If empty, parsing
         **    completed with no warnings or errors. If non-empty, there were
         **    parsing warnings and/or parsing errors.
--- a/cif-parser/src/CifParserBase.C
+++ b/cif-parser/src/CifParserBase.C
@@ -148,7 +148,7 @@ void CifParser::Parse(const string& file
     if (RcsbFile::IsEmpty(log))
     {
         log.close();
-        RcsbFile::Delete(logFileName);
+        if( logFileName != "/dev/null" ) RcsbFile::Delete(logFileName);
     }
     else
     {