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