CCIMXDesktop
 
Loading...
Searching...
No Matches
StandardFormater Class Reference

A concrete implementation of FormativeFactory for standard log formatting. More...

#include <StandardFormater.h>

Inheritance diagram for StandardFormater:
FormativeFactory

Classes

struct  LogFormatOptions
 Configuration options for log message formatting. More...
 

Public Member Functions

QString formativeFactory (QtMsgType type, const QMessageLogContext &context, const QString &msg) override
 Formats a log message according to configured options.
 
void setShowTimestamp (bool enable)
 Enable/disable timestamp display.
 
void setShowFile (bool enable)
 Enable/disable source file display.
 
void setShowLine (bool enable)
 Enable/disable line number display.
 
void setShowFunction (bool enable)
 Enable/disable function name display.
 
void setOptions (const LogFormatOptions &options)
 Set all formatting options at once.
 
LogFormatOptions options () const
 Get current formatting options.
 

Detailed Description

A concrete implementation of FormativeFactory for standard log formatting.

This class provides configurable formatting options for log messages, including timestamp, file, line, and function information display.

Member Function Documentation

◆ formativeFactory()

QString StandardFormater::formativeFactory ( QtMsgType  type,
const QMessageLogContext &  context,
const QString &  msg 
)
overridevirtual

Formats a log message according to configured options.

Parameters
typeThe log message type (debug, warning, etc.)
contextThe log message context (file, line, function)
msgThe actual log message
Returns
Formatted log message as QString

Implements FormativeFactory.

◆ options()

LogFormatOptions StandardFormater::options ( ) const

Get current formatting options.

Returns
Current formatting options

◆ setOptions()

void StandardFormater::setOptions ( const LogFormatOptions options)

Set all formatting options at once.

Parameters
optionsThe complete set of formatting options

◆ setShowFile()

void StandardFormater::setShowFile ( bool  enable)

Enable/disable source file display.

Parameters
enableTrue to show file names, false to hide

◆ setShowFunction()

void StandardFormater::setShowFunction ( bool  enable)

Enable/disable function name display.

Parameters
enableTrue to show function names, false to hide

◆ setShowLine()

void StandardFormater::setShowLine ( bool  enable)

Enable/disable line number display.

Parameters
enableTrue to show line numbers, false to hide

◆ setShowTimestamp()

void StandardFormater::setShowTimestamp ( bool  enable)

Enable/disable timestamp display.

Parameters
enableTrue to show timestamps, false to hide

The documentation for this class was generated from the following files: