Definition at line 582 of file mlogger.cxx.
◆ WriterGzip()
| WriterGzip::WriterGzip |
( |
LOG_CHN * |
log_chn, |
|
|
int |
compress |
|
) |
| |
|
inline |
Definition at line 585 of file mlogger.cxx.
586 {
588 printf(
"WriterGzip: path [%s]\n", log_chn->
path.c_str());
592 } else {
594 }
596 }
static void compress(int init_bits, gdGifBuffer *buffer, gdImagePtr im)
uint32_t gzip_compression
◆ ~WriterGzip()
| WriterGzip::~WriterGzip |
( |
| ) |
|
|
inline |
Definition at line 598 of file mlogger.cxx.
599 {
601 printf("WriterGzip: destructor\n");
603 }
◆ wr_close()
| int WriterGzip::wr_close |
( |
LOG_CHN * |
log_chn, |
|
|
int |
run_number |
|
) |
| |
|
inlinevirtual |
Implements WriterInterface.
Definition at line 689 of file mlogger.cxx.
690 {
691 int zerror;
692
694 printf(
"WriterGzip: close path [%s]\n", log_chn->
path.c_str());
695
697
699
700 zerror = gzflush(
fGzfp, Z_FINISH);
701
702 if (zerror != Z_OK) {
703 cm_msg(
MERROR,
"WriterGzip::wr_close",
"Cannot write to file \'%s\', gzflush(Z_FINISH) zerror %d, errno: %d (%s)", log_chn->
path.c_str(), zerror, errno, strerror(errno));
705 }
706
707 zerror = gzclose(
fGzfp);
709
710 if (zerror != Z_OK) {
711 cm_msg(
MERROR,
"WriterGzip::wr_close",
"Cannot write to file \'%s\', gzclose() zerror %d, errno: %d (%s)", log_chn->
path.c_str(), zerror, errno, strerror(errno));
713 }
714
716
718 }
double ss_file_size(const char *path)
INT cm_msg(INT message_type, const char *filename, INT line, const char *routine, const char *format,...)
◆ wr_get_chain()
| std::string WriterGzip::wr_get_chain |
( |
| ) |
|
|
inlinevirtual |
◆ wr_get_file_ext()
| std::string WriterGzip::wr_get_file_ext |
( |
| ) |
|
|
inlinevirtual |
◆ wr_open()
| int WriterGzip::wr_open |
( |
LOG_CHN * |
log_chn, |
|
|
int |
run_number |
|
) |
| |
|
inlinevirtual |
Implements WriterInterface.
Definition at line 605 of file mlogger.cxx.
606 {
607 int zerror;
608
611
613 printf(
"WriterGzip: open path [%s]\n", log_chn->
path.c_str());
614
616
619
620 fGzfp = gzopen(log_chn->
path.c_str(),
"wb");
622 cm_msg(
MERROR,
"WriterGzip::wr_open",
"Cannot write to file \'%s\', gzopen() errno %d (%s)", log_chn->
path.c_str(), errno, strerror(errno));
624 }
625
626 chmod(log_chn->
path.c_str(), 0444);
627
628
629
632 if (zerror != Z_OK) {
633 cm_msg(
MERROR,
"WriterGzip::wr_open",
"gzsetparams() zerror %d", zerror);
635 }
636 }
637
638#if ZLIB_VERNUM > 0x1235
639
640 zerror = gzbuffer(
fGzfp, 128*1024);
641 if (zerror != Z_OK) {
642 cm_msg(
MERROR,
"WriterGzip::wr_open",
"gzbuffer() zerror %d", zerror);
644 }
645#else
646#warning Very old zlib, no gzbuffer()!
647#endif
648
650
653 }
static bool check_file_exists(const char *filename)
◆ wr_write()
| int WriterGzip::wr_write |
( |
LOG_CHN * |
log_chn, |
|
|
const void * |
data, |
|
|
const int |
size |
|
) |
| |
|
inlinevirtual |
Implements WriterInterface.
Definition at line 655 of file mlogger.cxx.
656 {
658 printf(
"WriterGzip: write path [%s], size %d\n", log_chn->
path.c_str(), size);
659
660 if (size == 0)
662
664
666
668
669 if (wr != size) {
670 cm_msg(
MERROR,
"WriterGzip::wr_write",
"Cannot write to file \'%s\', gzwrite(%d) returned %d, errno: %d (%s)", log_chn->
path.c_str(), size, wr, errno, strerror(errno));
672 }
673
674#if ZLIB_VERNUM > 0x1235
675
677#else
678#warning Very old zlib, no gzoffset()!
679 time_t now = time(NULL);
683 }
684#endif
685
687 }
◆ fCompress
| int WriterGzip::fCompress |
|
private |
◆ fFilename
| std::string WriterGzip::fFilename |
|
private |
◆ fGzfp
◆ fLastCheckTime
| time_t WriterGzip::fLastCheckTime |
|
private |
The documentation for this class was generated from the following file: