FreeNOS
Public Member Functions | Protected Member Functions | Private Attributes
DeviceLog Class Reference

Generic logger that writes to a Device object. More...

#include <DeviceLog.h>

Inheritance diagram for DeviceLog:
Log WeakSingleton< Log >

Public Member Functions

 DeviceLog (Device &device)
 Constructor. More...
 
- Public Member Functions inherited from Log
 Log ()
 Constructor. More...
 
virtual ~Log ()
 Destructor. More...
 
Level getMinimumLogLevel ()
 Get the minimum logging level. More...
 
void setMinimumLogLevel (Level level)
 Set the minimum logging level. More...
 
void append (const char *str)
 Append to buffered output. More...
 
void setIdent (const char *ident)
 Set log identity. More...
 
const char * getIdent () const
 Retrieve log identify. More...
 
virtual void terminate () const
 Terminate the program immediately. More...
 
- Public Member Functions inherited from WeakSingleton< Log >
 WeakSingleton (Log *obj)
 Constructor. More...
 

Protected Member Functions

virtual void write (const char *str)
 Write a string to the Device one character at a time. More...
 

Private Attributes

Devicem_device
 Device instance. More...
 

Additional Inherited Members

- Public Types inherited from Log
enum  Level {
  Emergency, Alert, Critical, Error,
  Warning, Notice, Info, Debug
}
 Logging level values. More...
 
- Static Public Member Functions inherited from WeakSingleton< Log >
static Loginstance ()
 Retrieve the instance. More...
 

Detailed Description

Generic logger that writes to a Device object.

See also
Device

Definition at line 38 of file DeviceLog.h.

Constructor & Destructor Documentation

◆ DeviceLog()

DeviceLog::DeviceLog ( Device device)

Constructor.

Parameters
deviceDevice instance to write log messages to

Definition at line 23 of file DeviceLog.cpp.

Member Function Documentation

◆ write()

void DeviceLog::write ( const char *  str)
protectedvirtual

Write a string to the Device one character at a time.

Parameters
strNUL-terminated string

Implements Log.

Definition at line 28 of file DeviceLog.cpp.

References FileSystemMessage::action, IOBuffer::bufferedWrite(), String::length(), m_device, FileSystemMessage::size, File::write(), and FileSystem::WriteFile.

Field Documentation

◆ m_device

Device& DeviceLog::m_device
private

Device instance.

Definition at line 61 of file DeviceLog.h.

Referenced by write().


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