class Poco::LogFile

Overview

This class is used by FileChannel to work with a log file. Moreā€¦

#include <LogFile.h>

class LogFile: public Poco::LogFileImpl
{
public:
    // construction

    LogFile(const std::string& path);

    // methods

    void
    write(
        const std::string& text,
        bool flush = true
        );

    UInt64
    size() const;

    Timestamp
    creationDate() const;

    const std::string&
    path() const;
};

Inherited Members

public:
    // methods

    void
    writeImpl(
        const std::string& text,
        bool flush
        );

    UInt64
    sizeImpl() const;

    Timestamp
    creationDateImpl() const;

    const std::string&
    pathImpl() const;

Detailed Documentation

This class is used by FileChannel to work with a log file.

Construction

LogFile(const std::string& path)

Creates the LogFile.

Methods

void
write(
    const std::string& text,
    bool flush = true
    )

Writes the given text to the log file.

If flush is true, the text will be immediately flushed to the file.

UInt64
size() const

Returns the current size in bytes of the log file.

Timestamp
creationDate() const

Returns the date and time the log file was created.

const std::string&
path() const

Returns the path given in the constructor.