001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.networktables;
006
007/** NetworkTables log message. */
008public final class LogMessage {
009  /** Logging levels. */
010  public static final int kCritical = 50;
011
012  public static final int kError = 40;
013  public static final int kWarning = 30;
014  public static final int kInfo = 20;
015  public static final int kDebug = 10;
016  public static final int kDebug1 = 9;
017  public static final int kDebug2 = 8;
018  public static final int kDebug3 = 7;
019  public static final int kDebug4 = 6;
020
021  /** The logger that generated the message. */
022  @SuppressWarnings("MemberName")
023  public final int logger;
024
025  /** Log level of the message. */
026  @SuppressWarnings("MemberName")
027  public final int level;
028
029  /** The filename of the source file that generated the message. */
030  @SuppressWarnings("MemberName")
031  public final String filename;
032
033  /** The line number in the source file that generated the message. */
034  @SuppressWarnings("MemberName")
035  public final int line;
036
037  /** The message. */
038  @SuppressWarnings("MemberName")
039  public final String message;
040
041  /**
042   * Constructor. This should generally only be used internally to NetworkTables.
043   *
044   * @param inst Instance
045   * @param logger Logger
046   * @param level Log level
047   * @param filename Filename
048   * @param line Line number
049   * @param message Message
050   */
051  public LogMessage(
052      NetworkTableInstance inst, int logger, int level, String filename, int line, String message) {
053    this.m_inst = inst;
054    this.logger = logger;
055    this.level = level;
056    this.filename = filename;
057    this.line = line;
058    this.message = message;
059  }
060
061  private final NetworkTableInstance m_inst;
062
063  NetworkTableInstance getInstance() {
064    return m_inst;
065  }
066}