rlog::FileNode Class Reference

Provides filename based logging nodes. More...

#include <rlog/rloglocation.h>

Inheritance diagram for rlog::FileNode:

rlog::RLogNode List of all members.

Public Member Functions

 FileNode (const char *componentName, const char *fileName)
 FileNode (const char *fileName)
 RLOG_NO_COPY (FileNode)

Static Public Member Functions

static FileNodeLookup (const char *componentName, const char *fileName)
static FileNodeLookup (const char *fileName)

Public Attributes

std::string componentName
std::string fileName

Detailed Description

Provides filename based logging nodes.

This allows subscribing to messages only from particular files. For example,

  int main()
  {
      // display some messages to stderr
      StdioNode std( STDERR_FILENO );

      // subscribe to everything from this file
      std.subscribeTo( FileNode::Lookup( __FILE__ ) );

      // and everything from "important.cpp"
      std.subscribeTo( FileNode::Lookup( "important.cpp" ));
  }

Note that file names are not required to be unique across the entire program. Different components may contain the same filename, which is why there is a second Lookup function which also takes the component name.

See also:
RLogChannel
Author:
Valient Gough


The documentation for this class was generated from the following files:
Generated on Mon Nov 20 22:57:45 2006 for rlog by  doxygen 1.5.0