Skip to content

Tags

In the labyrinth of log messages that a software produces, distinguishing between various levels of severity or purposes becomes crucial. Just as a librarian would tag books for easy discovery, developers need a way to categorize logs quickly. The TagSettings class in Cobra Logging offers just the right set of tools for this.

A component of ByteCobra.Logging.Settings, the TagSettings class furnishes the facility to set prefixes or 'tags' for each log type. These tags ensure that a developer can, at a glance, understand the nature of the log.

Why Tags Are Important?

Imagine reading a book without chapter titles or headings. It becomes challenging, right? Similarly, tags in logs serve as these headings, offering an immediate understanding of the message's intent.

Understanding the Tags

  • FatalTag: An tag for the logs that signal something went fatally wrong. Default: "[FATAL]".
  • ErrorTag: Marks logs that point towards an error in the system. These might not be as dire as fatal logs but certainly require attention. Default: "[ERROR]".
  • WarningTag: Highlights logs that warn of potential issues. These aren't necessarily errors but suggest that something might be amiss. Default: "[WARNING]".
  • InfoTag: These tags label general informational logs, providing context or details about the system's operation. Default: "[INFO]".
  • DebugTag: An insignia for logs used in debugging. These are typically rich in detail, aiding developers in tracing and fixing issues. Default: "[DEBUG]".
  • AssertTag: Represents logs that come into play for assertions. These are used to confirm if a condition holds true and log when it doesn't. Default: "[ASSERT]".