github.com/iDigitalFlame/xmt@v0.5.4/util/bugtrack/no_bugtrack.go (about)

     1  //go:build !bugs
     2  // +build !bugs
     3  
     4  // Copyright (C) 2020 - 2023 iDigitalFlame
     5  //
     6  // This program is free software: you can redistribute it and/or modify
     7  // it under the terms of the GNU General Public License as published by
     8  // the Free Software Foundation, either version 3 of the License, or
     9  // any later version.
    10  //
    11  // This program is distributed in the hope that it will be useful,
    12  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    13  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  // GNU General Public License for more details.
    15  //
    16  // You should have received a copy of the GNU General Public License
    17  // along with this program.  If not, see <https://www.gnu.org/licenses/>.
    18  //
    19  
    20  // Package bugtrack enables the bug tracking system, which is comprised of a
    21  // global logger that will write to Standard Error and on the filesystem in a
    22  // temporary directory, "$TEMP" in *nix and "%TEMP%" on Windows, that is named
    23  // "bugtrack-<PID>.log".
    24  //
    25  // To enable bug tracking, use the "bugs" build tag.
    26  package bugtrack
    27  
    28  // Enabled is the stats of the bugtrack package.
    29  //
    30  // This is true if bug tracking is enabled.
    31  const Enabled = false
    32  
    33  // Recover is a "guard" function to be used to gracefully shut down a program
    34  // when a panic is detected.
    35  //
    36  // Can be en enabled by using:
    37  //
    38  //	if bugtrack.Enabled {
    39  //	    defer bugtrack.Recover("thread-name")
    40  //	}
    41  //
    42  // The specified name will be entered into the bugtrack log and a stack trace
    43  // will be generated before gracefully execution to the program.
    44  func Recover(_ string) {}
    45  
    46  // Track is a simple logging function that takes the same arguments as a
    47  // 'fmt.Sprintf' function. This can be used to track bugs or output values.
    48  //
    49  // Not recommended to be used in production environments.
    50  //
    51  // The "-tags bugs" option is required in order for this function to be used.
    52  func Track(_ string, _ ...interface{}) {}