• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdenetwork
  • Sitemap
  • Contact Us
 

kget

bt::Log

bt::Log Class Reference

#include <log.h>

List of all members.


Detailed Description

Author:
Joris Guisson

Class which writes messages to a logfile

This class writes messages to a logfile. To use it, create an instance, set the output file and write stuff with the << operator.

By default all messages will also be printed on the standard output. This can be turned down using the setOutputToConsole function.

There is also the possibility to monitor what is written to the log using the LogMonitorInterface class.

Definition at line 74 of file log.h.


Public Member Functions

void addMonitor (LogMonitorInterface *m)
void lock ()
 Log ()
void logRotateDone ()
Log & operator<< (const KUrl &url)
Log & operator<< (Int64 v)
Log & operator<< (Uint64 v)
Log & operator<< (const QString &s)
Log & operator<< (const char *s)
Log & operator<< (Log &(*func)(Log &))
template<class T>
Log & operator<< (T val)
void removeMonitor (LogMonitorInterface *m)
void setFilter (unsigned int filter)
void setOutputFile (const QString &file, bool rotate)
void setOutputToConsole (bool on)
virtual ~Log ()

Friends

BTCORE_EXPORT friend Log & endl (Log &lg)

Constructor & Destructor Documentation

bt::Log::Log (  ) 

Constructor.

Definition at line 178 of file log.cpp.

bt::Log::~Log (  )  [virtual]

Destructor, closes the file.

Definition at line 184 of file log.cpp.


Member Function Documentation

void bt::Log::addMonitor ( LogMonitorInterface *  m  ) 

Add a log monitor.

Parameters:
m The log monitor

Definition at line 195 of file log.cpp.

void bt::Log::lock (  ) 

Lock the mutex of the log, should be called in Out().

Definition at line 257 of file log.cpp.

void bt::Log::logRotateDone (  ) 

Called by the auto log rotate job when it has finished.

Definition at line 212 of file log.cpp.

Log & bt::Log::operator<< ( const KUrl &  url  ) 

Write an URL to the file.

Parameters:
text The KUrl
Returns:
This Log

Definition at line 224 of file log.cpp.

Log & bt::Log::operator<< ( Int64  v  ) 

Output a 64 bit integer to the log.

Parameters:
v The integer
Returns:
This Log

Definition at line 247 of file log.cpp.

Log & bt::Log::operator<< ( Uint64  v  ) 

Output a 64 bit integer to the log.

Parameters:
v The integer
Returns:
This Log

Definition at line 242 of file log.cpp.

Log & bt::Log::operator<< ( const QString &  s  ) 

Output a QString to the log.

Parameters:
s The QString
Returns:
This Log

Definition at line 230 of file log.cpp.

Log & bt::Log::operator<< ( const char *  s  ) 

Output a QString to the log.

Parameters:
s The QString
Returns:
This Log

Definition at line 236 of file log.cpp.

Log& bt::Log::operator<< ( Log &(*)(Log &)  func  )  [inline]

Apply a function to the Log.

Parameters:
func The function
Returns:
This Log

Definition at line 134 of file log.h.

template<class T>
Log& bt::Log::operator<< ( T  val  )  [inline]

Write a number to the log file.

Anything which can be passed to QString::number will do.

Parameters:
val The value
Returns:
This Log

Definition at line 124 of file log.h.

void bt::Log::removeMonitor ( LogMonitorInterface *  m  ) 

Remove a log monitor.

Parameters:
m The log monitor

Definition at line 200 of file log.cpp.

void bt::Log::setFilter ( unsigned int  filter  ) 

Sets a filter for log messages.

Applies only to listeners via LogMonitorInterface!

Parameters:
filter SYS & LOG flags combined with bitwise OR.

Definition at line 252 of file log.cpp.

void bt::Log::setOutputFile ( const QString &  file,
bool  rotate 
)

Set the output logfile.

Parameters:
file The name of the file
rotate Whether or not to rotate the logs
Exceptions:
Exception if the file can't be opened

Definition at line 190 of file log.cpp.

void bt::Log::setOutputToConsole ( bool  on  ) 

Enable or disable the printing of log messages to the standard output.

Parameters:
on Enable or disable

Definition at line 207 of file log.cpp.


Friends And Related Function Documentation

BTCORE_EXPORT friend Log& endl ( Log &  lg  )  [friend]

Prints and endline character to the Log and flushes it.

Parameters:
lg The Log
Returns:
lg

Definition at line 217 of file log.cpp.


The documentation for this class was generated from the following files:
  • log.h
  • log.cpp

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal