def colorize_message(message)
      message = message.sub('MONGODB', color('MONGODB', odd? ? CYAN : MAGENTA)).
        sub(%r{(?<=\[')([^']+)}) {|m| color(m, BLUE)}.
        sub(%r{(?<=\]\.)\w+}) {|m| color(m, YELLOW)}
      message.sub('MOPED:', color('MOPED:', odd? ? CYAN : MAGENTA)).
        sub(/\{.+?\}\s/) { |m| color(m, BLUE) }.
        sub(/COMMAND|QUERY|KILL_CURSORS|INSERT|DELETE|UPDATE|GET_MORE|STARTED/) { |m| color(m, YELLOW) }.
        sub(/SUCCEEDED/) { |m| color(m, GREEN) }.
        sub(/FAILED/) { |m| color(m, RED) }.
        sub(/[\d\.]+(s|ms)/) { |m| color(m, GREEN) }
    end
def colorize_message(message)
      message = message.sub('MONGODB', color('MONGODB', odd? ? CYAN : MAGENTA)).
        sub(%r{(?<=\[')([^']+)}) {|m| color(m, BLUE)}.
        sub(%r{(?<=\]\.)\w+}) {|m| color(m, YELLOW)}
      message.sub('MOPED:', color('MOPED:', odd? ? CYAN : MAGENTA)).
        sub(/\{.+?\}\s/) { |m| color(m, BLUE) }.
        sub(/COMMAND|QUERY|KILL_CURSORS|INSERT|DELETE|UPDATE|GET_MORE|STARTED/) { |m| color(m, YELLOW) }.
        sub(/SUCCEEDED/) { |m| color(m, GREEN) }.
        sub(/FAILED/) { |m| color(m, RED) }.
        sub(/[\d\.]+(s|ms)/) { |m| color(m, GREEN) }
    end
Used for Mongoid >= 3.0