Documentation ¶
Index ¶
- Constants
- func Config()
- func FileInfoFindGood() string
- func LogServiceBasic(serviceName string) *log.Entry
- func LogServiceBasicWithFields(serviceName string, fields log.Fields) *log.Entry
- func LogStackTrace()
- func NewDlaaSLogData(serviceName string) log.Fields
- type LocLoggingEntry
- func (entry *LocLoggingEntry) Debug(args ...interface{})
- func (entry *LocLoggingEntry) Debugf(format string, args ...interface{})
- func (entry *LocLoggingEntry) Debugln(args ...interface{})
- func (entry *LocLoggingEntry) Error(args ...interface{})
- func (entry *LocLoggingEntry) Errorf(format string, args ...interface{})
- func (entry *LocLoggingEntry) Errorln(args ...interface{})
- func (entry *LocLoggingEntry) Fatal(args ...interface{})
- func (entry *LocLoggingEntry) Fatalf(format string, args ...interface{})
- func (entry *LocLoggingEntry) Fatalln(args ...interface{})
- func (entry *LocLoggingEntry) Info(args ...interface{})
- func (entry *LocLoggingEntry) Infof(format string, args ...interface{})
- func (entry *LocLoggingEntry) Infoln(args ...interface{})
- func (entry *LocLoggingEntry) MakeNew(logr *log.Entry) *LocLoggingEntry
- func (entry *LocLoggingEntry) Panic(args ...interface{})
- func (entry *LocLoggingEntry) Panicf(format string, args ...interface{})
- func (entry *LocLoggingEntry) Panicln(args ...interface{})
- func (entry *LocLoggingEntry) Print(args ...interface{})
- func (entry *LocLoggingEntry) Printf(format string, args ...interface{})
- func (entry *LocLoggingEntry) Println(args ...interface{})
- func (entry *LocLoggingEntry) Warn(args ...interface{})
- func (entry *LocLoggingEntry) Warnf(format string, args ...interface{})
- func (entry *LocLoggingEntry) Warning(args ...interface{})
- func (entry *LocLoggingEntry) Warningf(format string, args ...interface{})
- func (entry *LocLoggingEntry) Warningln(args ...interface{})
- func (entry *LocLoggingEntry) Warnln(args ...interface{})
- func (entry *LocLoggingEntry) WithError(err error) *LocLoggingEntry
- func (entry *LocLoggingEntry) WithField(key string, value interface{}) *LocLoggingEntry
- func (entry *LocLoggingEntry) WithFields(fields log.Fields) *LocLoggingEntry
Constants ¶
const ( // ============================== // ======= Log field keys ======= // These keys are to be used for structured logging, and will // be visible to the Elastic Search repository for query and the like. LogkeyCaller = "caller_info" LogkeyTrainingID = "training_id" LogkeyGpuType = "gpu_type" LogkeyGpuUsage = "gpu_usage" LogkeyFramework = "framework_name" LogkeyFrameworkVersion = "framework_version" LogkeyErrorCode = "error_code" LogkeyErrorType = "error_type" LogkeyModelID = "model_id" LogkeyModelName = "model_name" LogkeyDBName = "db_name" LogkeyUserID = "user_id" LogkeyModule = "module" LogkeyIsMetrics = "is_metrics" LogkeyIsFollow = "is_follow" LogkeyIsSummary = "is_summary" LogkeyObjectstorePath = "os_path" LogkeyTrainingDataURI = "training_data_uri" LogkeyModelDataURI = "model_data_uri" LogkeyModelFilename = "model_filename" LogkeyDeployerService = "deployer-service" LogkeyLcmService = "lifecycle-manager-service" LogkeyRestAPIService = "rest-api" LogkeyStorageService = "storage-service" LogkeyTrainerService = "trainer-service" LogkeyVolumeManagerService = "volume-manager-service" LogkeyJobMonitor = "jobmonitor" // DLAAS_LOG_GETTRAININGLOGSTREAM=true LogCategoryGetTrainingLogStream = "log_GetTrainingLogStream" LogCategoryGetTrainingLogStreamDefaultValue = false // DLAAS_LOG_GETTRAININGLOGSTREAMFROMOBJSTORE=true LogCategoryGetTrainingLogStreamFromObjStore = "log_getTrainingLogStreamFromObjStore" LogCategoryGetTrainingLogStreamFromObjStoreDefaultValue = false // DLAAS_LOG_REPOSITORY=true LogCategoryRepository = "log_repository" LogCategoryRepositoryDefaultValue = false // DLAAS_LOG_SERVELOGHANDLER=true LogCategoryServeLogHandler = "log_serveLogHandler" LogCategoryServeLogHandlerDefaultValue = false )
Constants for logging
Variables ¶
This section is empty.
Functions ¶
func Config ¶
func Config()
Config initializes the logging by setting the env var LOGLEVEL=<level>. Valid level values are: panic, fatal, error, warn, info, debug
func FileInfoFindGood ¶
func FileInfoFindGood() string
FileInfoFindGood looks at the stack, and tries to find the first entry that is not infrastructure related. i.e. that is essentially application code.
func LogServiceBasic ¶
LogServiceBasic Construct new basic logger for service.
func LogServiceBasicWithFields ¶
LogServiceBasicWithFields Construct new basic logger for service, with key/value pairs.
func NewDlaaSLogData ¶
NewDlaaSLogData construct log data object.
Types ¶
type LocLoggingEntry ¶
type LocLoggingEntry struct { Logger *log.Entry // If true, enable functions at the level of debug, info, and print. // Warn, Error, Fatal, and Panic are always enabled. Enabled bool }
LocLoggingEntry wraps another logger, and add code location information about where the the log entry occurs. Because logging can be expensive, especially logging that needs to figure out it's location, this class also has a way to disable the logging for debug/informational entries.
func LocLogger ¶
func LocLogger(logr *log.Entry) *LocLoggingEntry
LocLogger simply creates a LocLoggingEntry that wraps another logger.
func LocLoggerCategorized ¶
func LocLoggerCategorized(logr *log.Entry, isEnabledKey string) *LocLoggingEntry
LocLoggerCategorized creates a LocLoggingEntry that wraps another logger, and accepts a string that is used with viper to say whether the informational/debug logging is enabled for this logger.
func (*LocLoggingEntry) Debug ¶
func (entry *LocLoggingEntry) Debug(args ...interface{})
func (*LocLoggingEntry) Debugf ¶
func (entry *LocLoggingEntry) Debugf(format string, args ...interface{})
func (*LocLoggingEntry) Debugln ¶
func (entry *LocLoggingEntry) Debugln(args ...interface{})
func (*LocLoggingEntry) Error ¶
func (entry *LocLoggingEntry) Error(args ...interface{})
func (*LocLoggingEntry) Errorf ¶
func (entry *LocLoggingEntry) Errorf(format string, args ...interface{})
func (*LocLoggingEntry) Errorln ¶
func (entry *LocLoggingEntry) Errorln(args ...interface{})
func (*LocLoggingEntry) Fatal ¶
func (entry *LocLoggingEntry) Fatal(args ...interface{})
func (*LocLoggingEntry) Fatalf ¶
func (entry *LocLoggingEntry) Fatalf(format string, args ...interface{})
func (*LocLoggingEntry) Fatalln ¶
func (entry *LocLoggingEntry) Fatalln(args ...interface{})
func (*LocLoggingEntry) Info ¶
func (entry *LocLoggingEntry) Info(args ...interface{})
func (*LocLoggingEntry) Infof ¶
func (entry *LocLoggingEntry) Infof(format string, args ...interface{})
func (*LocLoggingEntry) Infoln ¶
func (entry *LocLoggingEntry) Infoln(args ...interface{})
func (*LocLoggingEntry) MakeNew ¶
func (entry *LocLoggingEntry) MakeNew(logr *log.Entry) *LocLoggingEntry
MakeNew makes a new LocLoggingEntry from an existing LocLoggingEntry, but using a new inner logger.
func (*LocLoggingEntry) Panic ¶
func (entry *LocLoggingEntry) Panic(args ...interface{})
func (*LocLoggingEntry) Panicf ¶
func (entry *LocLoggingEntry) Panicf(format string, args ...interface{})
func (*LocLoggingEntry) Panicln ¶
func (entry *LocLoggingEntry) Panicln(args ...interface{})
func (*LocLoggingEntry) Print ¶
func (entry *LocLoggingEntry) Print(args ...interface{})
func (*LocLoggingEntry) Printf ¶
func (entry *LocLoggingEntry) Printf(format string, args ...interface{})
func (*LocLoggingEntry) Println ¶
func (entry *LocLoggingEntry) Println(args ...interface{})
func (*LocLoggingEntry) Warn ¶
func (entry *LocLoggingEntry) Warn(args ...interface{})
func (*LocLoggingEntry) Warnf ¶
func (entry *LocLoggingEntry) Warnf(format string, args ...interface{})
func (*LocLoggingEntry) Warning ¶
func (entry *LocLoggingEntry) Warning(args ...interface{})
func (*LocLoggingEntry) Warningf ¶
func (entry *LocLoggingEntry) Warningf(format string, args ...interface{})
func (*LocLoggingEntry) Warningln ¶
func (entry *LocLoggingEntry) Warningln(args ...interface{})
func (*LocLoggingEntry) Warnln ¶
func (entry *LocLoggingEntry) Warnln(args ...interface{})
func (*LocLoggingEntry) WithError ¶
func (entry *LocLoggingEntry) WithError(err error) *LocLoggingEntry
Add an error as single field (using the key defined in ErrorKey) to the Entry.
func (*LocLoggingEntry) WithField ¶
func (entry *LocLoggingEntry) WithField(key string, value interface{}) *LocLoggingEntry
Add a single field to the Entry.
func (*LocLoggingEntry) WithFields ¶
func (entry *LocLoggingEntry) WithFields(fields log.Fields) *LocLoggingEntry
Add a map of fields to the Entry.