Module: MongoActions

Includes:
Colors
Included in:
MongoBeautifulLogger
Defined in:
lib/mongo_beautiful_logger/mongo_actions.rb

Constant Summary collapse

FIND =

substring matches and the corresponding colors for mongodb actions

{ match: "\"find\"#{arrow}",        color: BLUE }
UPDATE =
{ match: "\"update\"#{arrow}",      color: YELLOW }
INSERT =
{ match: "\"insert\"#{arrow}",      color: GREEN }
DELETE =
{ match: "\"delete\"#{arrow}",      color: RED }
AGGREGATE =
{ match: "\"aggregate\"#{arrow}",   color: MAGENTA }
SUCCEEDED =
{ match: "succeeded",               color: GREEN }
FAILED =
{ match: "failed",                  color: RED }
ERROR =
{ match: "error",                   color: RED }
ENDSESSION =
{ match: "\"endsessions\"#{arrow}", color: YELLOW }
INITIALIZING =
{ match: "initializing",            color: GREEN }
ACTIONS =
[ FIND, UPDATE, INSERT, DELETE, AGGREGATE, 
SUCCEEDED, FAILED, ERROR, ENDSESSION, INITIALIZING ]
UNNECESSARY =

substring matches for unnecessary log messages that will be filtered out

["opology", "server description"]
PREFIX_REGEX =

regex for the log prefix that will be filtered out matches: | localhost:27017 | app_test.update | STARTED | note: | STARTED | and | SUCCEEDED | will be filtered due to redundancy, but | FAILED | and others will not

/\|.*?\|.*?\|( (SUCCEEDED|STARTED) \|)?/

Constants included from Colors

Colors::BLACK, Colors::BLUE, Colors::BOLD, Colors::CLEAR, Colors::CYAN, Colors::GREEN, Colors::MAGENTA, Colors::RED, Colors::WHITE, Colors::YELLOW