DATAKIT SDK  V2026.4
dtk_log.hpp
Go to the documentation of this file.
1 #ifndef _DTK_LOG_HPP_
2 #define _DTK_LOG_HPP_
3 #include "def/define.h"
7 #include "util/error_dtk.hpp"
8 #include "util/util_stl_dtk.hpp"
9 #include <memory>
10 
11 class Dtk_Log;
13 
15 {
16 protected:
17  struct Dtk_Handle; // Not defined here
18  std::unique_ptr<Dtk_Handle> _Private; // Handle
19  friend class Dtk_SmartPtr<Dtk_Log>;
20 
21 public:
23  Dtk_Log_Inventory(const Dtk_Log_Inventory& inInventory);
28 
29  //! \brief Get total count of entities in inventory
30  //! \return Total count of entities
32 
33  //! \brief Get number of entity types in inventory
34  //! \return Number of entity types
36 
37  //! \brief Get entity type in inventory from index
38  //! \param [in] inIndex : Index (with range [0..GetNbEntityTypes()-1])
39  //! \return Entity type
40  const Dtk_string & GetEntityType(Dtk_Size_t inIndex) const;
41 
42  //! \brief Get count of entities with the same type in inventory from index
43  //! \param [in] inIndex : Index (with range [0..GetNbEntityTypes()-1])
44  //! \return Count of entities
45  int GetEntitiesCount(Dtk_Size_t inIndex) const;
46 
47  //! \brief Adds entity type and its count to inventory
48  //! \param [in] inCount : Count of entities
49  //! \param [in] inName : Entity type
50  // must only be called to fill inventory
51  void AddEntity(int inCount, const Dtk_string& inName);
52 };
53 
55 {
56 protected:
57  struct Dtk_Handle; // Not defined here
58  std::unique_ptr<Dtk_Handle> _Private; // Handle
59 
60 public:
62  Dtk_Log_Message(const Dtk_Log_Message& inMessage);
67 
68  //! \brief Get message type
69  //! \return Message type
70  const Dtk_string & GetType() const;
71 
72  //! \brief Get message
73  //! \return Message
74  const Dtk_string & GetMessageInfo() const;
75 
76  //! \brief Set message type
77  //! \param [in] inValue : Message type
78  void SetType(const Dtk_string& inValue);
79 
80  //! \brief Set message
81  //! \param [in] inValue : Message
82  void SetMessageInfo(const Dtk_string& inValue);
83 };
84 
86 {
87 protected:
88  struct Dtk_Handle; // Not defined here
89  std::unique_ptr<Dtk_Handle> _Private; // Handle
90 
91 public:
98 
99  //! \brief Get if component is a catalog or a not
100  //! \return DTK_TRUE if it is a catalog, DTK_FALSE if otherwise
102 
103  //! \brief Get if component is an assembly or a part
104  //! \return DTK_TRUE if it is an assembly, DTK_FALSE if it is a part
106 
107  //! \brief Get if component is internal
108  //! \return DTK_TRUE if it is internal, DTK_FALSE otherwise
110 
111  //! \brief Get name of component
112  //! \return Name of component
113  const Dtk_string & GetName() const;
114 
115  //! \brief Get full path name of component
116  //! \return Full path name of component
117  const Dtk_string & GetFullPathName() const;
118 
119  //! \brief Get number of instantiations of component
120  //! \return Number of instantiations of component
121  int GetQuantity() const;
122 
123  //! \brief Get file size of component
124  //! \return File size of component
125  long GetFileSize() const;
126 
127  //! \brief Get unit scale of component
128  //! \return Dtk_Double64 in millimeters
130 
131  //! \brief Get file version of component
132  //! \return File version of component
133  const Dtk_string & GetFileVersion() const;
134 
135  //! \brief Get path of component
136  //! \return Path of component
137  const Dtk_string & GetPath() const;
138 
139  //! \brief Set if component is a catalog
140  //! \param [in] inVal : DTK_TRUE if it is a catalog, DTK_FALSE otherwise
142 
143  //! \brief Set if component is an assembly or a part.
144  //! \param [in] inVal : DTK_TRUE if it is an assembly, DTK_FALSE if it is a part
146 
147  //! \brief Set if component is internal
148  //! \param [in] inVal : DTK_TRUE if it is internal, DTK_FALSE otherswise
150 
151  //! \brief Set name of component
152  //! \param [in] inVal : Name of component
153  void SetName(const Dtk_string& val);
154 
155  //! \brief Set full path name of component
156  //! \param [in] inVal : Full path name of component
157  void SetFullPathName(const Dtk_string& val);
158 
159  //! \brief Set number of instantiations of component
160  //! \param [in] inVal : Number of instantiations of component
161  void SetQuantity(int val);
162 
163  //! \brief Set file size of component
164  //! \param [in] inVal : File size of component
165  void SetFileSize(long val);
166 
167  //! \brief Set unit scale of component
168  //! \param [in] inVal : Dtk_Double64 in millimeters
170 
171  //! \brief Set file version of component
172  //! \param [in] inVal : File version of component
173  void SetFileVersion(const Dtk_string& val);
174 };
175 
176 class Dtk_Log : public Dtk_Object
177 {
178 protected:
179  struct Dtk_Handle; // Not defined here
180  std::unique_ptr<Dtk_Handle> _Private; // Handle
181  enum { _typeID = DTK_TYPE_LOG };
182 
183 private :
184  friend class Dtk_SmartPtr<Dtk_Log>;
185 
186 public:
188  virtual ~Dtk_Log();
189 
190  //! \CreateBase
191  static Dtk_LogPtr Create();
192  //! \brief downcasting
193  int DtkDynamicType(const int& inId);
194  static Dtk_Log * DtkDynamicCast(Dtk_Object * inObject);
195 
196  //! \brief Get log file name (with .xml extension)
197  //! \return Log file name
198  const Dtk_string & GetLogFileName() const;
199 
200  //! \brief Get API version
201  //! \return API version
202  int GetAPIVersion() const;
203 
204  //! \brief Get product mode
205  //! \return "Psk" if it uses Pskernel, "Dtk" if not
206  const Dtk_string & GetProductMode() const;
207 
208  //! \brief Get input format name
209  //! \return Input format name (an empty string is returned if reading is not used)
210  const Dtk_string & GetInputFormat() const;
211 
212  //! \brief Get output format name
213  //! \return Output format name (an empty string is returned if writing is not used)
214  const Dtk_string & GetOutputFormat() const;
215 
216  //! \brief Get healing flag
217  //! \return -1 if not set, 1 if healing is used, 0 if not
218  int GetHealingFlag() const;
219 
220  //! \brief Get config file name
221  //! \return Config file name
222  const Dtk_string & GetConfigFileName() const;
223 
224  //! \brief Get input file name
225  //! \return Input file name (an empty string is returned if reading is not used)
226  const Dtk_string & GetInputFileName() const;
227 
228  //! \brief Get file version of input file
229  //! \return File version of input file
231 
232  //! \brief Get output file name
233  //! \return Output file name (an empty string is returned if writing is not used)
234  const Dtk_string & GetOutputFileName() const;
235 
236  //! \brief Get size of output file
237  //! \return -1 if not set, size of output file otherwise
238  long GetOutputFileSize() const;
239 
240  //! \brief Get unit scale
241  //! \return double in millimeters
242  double GetUnitScale() const;
243 
244  //! \brief Get start time of process
245  //! \return Start time of process
246  time_t GetStartTime() const;
247 
248  //! \brief Get stop time of process
249  //! \return stop time of process
250  time_t GetStopTime() const;
251 
252  //! \brief Get start hour of process
253  //! \return Start hour of process
254  const Dtk_string & GetStartHour() const;
255 
256  //! \brief Get stop hour of process
257  //! \return stop hour of process
258  const Dtk_string & GetStopHour() const;
259 
260  //! \brief Get CPU time of process
261  //! \return CPU time of process
262  double GetCPUTime() const;
263 
264  //! \brief Get wall time of process
265  //! \return Wall time of process
266  double GetWallTime() const;
267 
268  //! \brief Get peak working set size of process
269  //! \return CPU time of process
271 
272  //! \brief Get working set size of process
273  //! \return Wall time of process
275 
276  //! \brief Get Xsl schema name used in the .xml log file
277  //! \return Xsl schema name ("dtk_versionxxx.xsl")
278  const Dtk_string & GetXslSchemaName() const;
279 
280  //! \brief Get Folder that contains .xsl schema file used in .xml log file
281  //! \return Folder name that contains .xsl schema file
282  const Dtk_string & GetXslFolder() const;
283 
284  //! \brief Get full file path of the .xsl schema file used in .xml log file
285  //! \return File path of the .xsl schema file
287 
288  //! \brief Get if there was a crash or not
289  //! \return DTK_TRUE if yes, DTK_FALSE otherwise
291 
292  //! \brief Get number of sections of the configuration
293  //! \return Number of sections of the configuration
295 
296  //! \brief Get configuration section information (section name, parameters and values) from index
297  //! \param [in] inIndex : Index (with range [0..GetNbConfigSections()-1])
298  //! \param [out] outName : Section name
299  //! \param [out] outParameters : Array of parameters
300  //! \param [out] outValues : Array of values
301  //! \return dtkNoError if OK
303 
304  //! \brief Get list of ID of read components
305  //! \param [in] outListID : Array of component ID (it is empty if reading is not used)
307 
308  //! \brief Get component information from component ID
309  //! \param [in] inComponentID : Component ID
310  //! \param [out] outComponentInfo : Dtk_Log_Component_Info that contains component information
311  //! \return dtkNoError if OK
313 
314  //! \brief Get reading error status of component from component ID
315  //! \param [in] inComponentID : Component ID
316  //! \param [out] outReadingErrorStatus : Reading error status (Dtk_ErrorStatus)
317  //! \return dtkNoError if OK
319 
320  //! \brief Get inventory of component from its ID
321  //! \param [in] inComponentID : Component ID
322  //! \param [out] outInventory : Dtk_Log_Inventory that contains component inventory
323  //! \return dtkNoError if OK
325 
326  //! \brief Get synthetic inventory of component from its ID
327  //! \param [in] inComponentID : Component ID
328  //! \param [out] outInventory : Dtk_Log_Inventory that contains component inventory
329  //! \return dtkNoError if OK
331 
332  //! \brief Get warning messages associated to a component from its ID
333  //! \param [in] inComponentID : Component ID
334  //! \param [out] outMessages : Array of Dtk_Log_Message
335  //! \return dtkNoError if OK
337 
338  //! \brief Get error messages associated to a component from its ID
339  //! \param [in] inComponentID : Component ID
340  //! \param [out] outMessages : Array of Dtk_Log_Message
341  //! \return dtkNoError if OK
343 
344  //! \brief Get info messages associated to a component from its ID
345  //! \param [in] inComponentID : Component ID
346  //! \param [out] outMessages : Array of Dtk_Log_Message
347  //! \return dtkNoError if OK
349 
350  //! \brief Get global warning messages
351  //! \param [out] outMessages : Array of Dtk_Log_Message
352  //! \return dtkNoError if OK
354 
355  //! \brief Get global error messages
356  //! \param [out] outMessages : Array of Dtk_Log_Message
357  //! \return dtkNoError if OK
359 
360  //! \brief Get global info messages
361  //! \param [out] outMessages : Array of Dtk_Log_Message
362  //! \return dtkNoError if OK
364 
365  //! \brief Get List of ID of missing components
366  //! \return Array of Dtk_ID
367  // only useful for reading
369 
370  //! \brief Get list of names of written output files
371  //! \return Array of output file names
372  // only useful for writing
374 
375  //! \brief Get inventory of written output file from its name
376  //! \param [in] inFileName : Name of output file
377  //! \param [out] outInventory : Dtk_Log_Inventory that contains output file inventory
378  //! \return dtkNoError if OK
380 
381  //! \brief Get synthetic inventory of written output file from its name
382  //! \param [in] inFileName : Name of output file
383  //! \param [out] outInventory : Dtk_Log_Inventory that contains output file inventory
384  //! \return dtkNoError if OK
386 
387  //! \brief Get number of validation properties of an output file from its name
388  //! \param [in] inOutputFileName : Name of written output file
389  //! \return Number of validation properties
391 
392  //! \brief Get validation property of an output file from its name and index
393  //! \param [in] inOutputFileName : Name of written output file
394  //! \param [in] inIndex : Index (with range [0..GetNbOutputFileValidationProperties()-1])
395  //! \param [out] outEntityID : Entity ID
396  //! \param [out] outEntityType : Entity type
397  //! \param [out] outValPropName : Validation property name
398  //! \param [out] outRead : Read value
399  //! \param [out] outComputed : Computed value
400  //! \param [out] outGap : Gap value
401  //! \param [out] outStatus : Status
402  //! \return dtkNoError if OK
403  Dtk_ErrorStatus GetOutputFileValidationProperty(const Dtk_string& inOutputFileName, Dtk_Size_t inIndex, Dtk_string &outEntityID, Dtk_string &outEntityType,
404  Dtk_string &outValPropName, Dtk_string &outRead, Dtk_string &outComputed, Dtk_string &outGap, Dtk_string &outStatus);
405 
406  //! \brief Get number of validation properties of a component from its ID
407  //! \param [in] inComponentID : Component ID
408  //! \return Number of validation properties
410 
411  //! \brief Get validation property of a component from its ID and index
412  //! \param [in] inComponentID : Component ID
413  //! \param [in] inIndex : Index (with range [0..GetNbValidationProperties()-1])
414  //! \param [out] outEntityID : Entity ID
415  //! \param [out] outEntityType : Entity type
416  //! \param [out] outValPropName : Validation property name
417  //! \param [out] outRead : Read value
418  //! \param [out] outComputed : Computed value
419  //! \param [out] outGap : Gap value
420  //! \param [out] outStatus : Status
421  //! \return dtkNoError if OK
422  Dtk_ErrorStatus GetValidationProperty(Dtk_Size_t inComponentID, Dtk_Size_t inIndex, Dtk_string &outEntityID, Dtk_string &outEntityType,
423  Dtk_string &outValPropName, Dtk_string &outRead, Dtk_string &outComputed, Dtk_string &outGap, Dtk_string &outStatus);
424 
425  //! \brief Set log file name
426  //! \param [in] inVal : Log file name with .xml extension
427  void SetLogFileName(const Dtk_string& inVal);
428 
429  //! \brief Set product mode
430  //! \param [in] inVal : "Psk" if it uses Pskernel, "Dtk" if not
431  void SetProductMode(const Dtk_string& inVal);
432 
433  //! \brief Set input format name
434  //! \param [in] inVal : Input format name
435  void SetInputFormat(const Dtk_string& inVal);
436 
437  //! \brief Set output format name
438  //! \param [in] inVal : Output format name
439  void SetOutputFormat(const Dtk_string& inVal);
440 
441  //! \brief Set healing flag
442  //! \param [in] inVal : 1 if healing is used, 0 if not
443  void SetHealingFlag(int inVal);
444 
445  //! \brief Set config file name
446  //! \param [in] inVal : Config file name with .dtk extension
447  void SetConfigFileName(const Dtk_string& inVal);
448 
449  //! \brief Set input file name
450  //! \param [in] inVal : Input file name
451  void SetInputFileName(const Dtk_string& inVal);
452 
453  //! \brief Set input file version
454  //! \param [in] inVal : Input file version
455  void SetInputFileVersion(const Dtk_string& inVal);
456 
457  //! \brief Set output file name
458  //! \param [in] inVal : Output file name
459  void SetOutputFileName(const Dtk_string& inVal);
460 
461  //! \brief Set unit scale
462  //! \param [in] inVal : double in millimeters
463  void SetUnitScale(double inVal);
464 
465  //! \brief Set start time
466  //! \param [in] inVal : Start time
467  void SetStartTime(time_t inVal);
468 
469  //! \brief Set stop time
470  //! \param [in] inVal : Stop time
471  void SetStopTime(time_t inVal);
472 
473  //! \brief Set start hour
474  //! \param [in] inVal : Start hour
476 
477  //! \brief Set stop hour
478  //! \param [in] inVal : Stop hour
479  void SetStopHour(Dtk_string inVal);
480 
481  //! \brief Set CPU time
482  //! \param [in] inVal : CPU time
483  void SetCPUTime(double inVal);
484 
485  //! \brief Set wall time
486  //! \param [in] inVal : Wall time
487  void SetWallTime(double inVal);
488 
489  //! \brief Set Peak working set size
490  //! \param [in] inVal : CPU time
492 
493  //! \brief Set working set size
494  //! \param [in] inVal : Wall time
496 
497  //! \brief Set Folder that contains .xsl schema file to use in .xml log file
498  //! \param [in] inVal : Folder name that contains .xsl schema file
499  void SetXslFolder(const Dtk_string& inVal);
500 
501  //! \brief Tells if there was a crash or not
502  //! \param [in] inVal : DTK_TRUE if yes, DTK_FALSE otherwise
503  void SetIsCrash(Dtk_bool inVal);
504 
505  //! \brief Tells if .xsl must be embedded in the .xml log file
506  //! \param [in] inVal : DTK_TRUE if .xsl must be embedded in the .xml log file, DTK_FALSE otherwise
508 
509  //! \brief Fill log with config information (must be called after config initialization)
510  //! \return dtkNoError if OK
512 
513  //! \brief Associates temporary file to another file (used for writing when using temporary file to create another one)
514  //! \param [in] inTemporaryFile : Name of temporary file to associate
515  //! \param [out] inFileName : Name of file to be associated to the temporary file
516  //! \return dtkNoError if OK
517  Dtk_ErrorStatus AssociateFileNames(const Dtk_string& inTemporaryFile, const Dtk_string& inFileName);
518 
519  //! \brief Adds to log a reading inventory and associates it to a component from its ID
520  //! \param [in] inComponentID : Component ID
521  //! \param [in] inNum : Number of entity types
522  //! \param [in] inCount : Array of count of entities (size of array must be inNum)
523  //! \param [in] inEntitiesName : Array of entity names (size of array must be inNum)
524  //! \return dtkNoError if OK
525  Dtk_ErrorStatus AddReadingInventory(Dtk_ID inComponentID, int inNum, const int *inCount, const char **inEntitiesName);
526 
527  //! \brief Adds to log a reading inventory and associates it to a component from its ID
528  //! \param [in] inComponentID : Component ID
529  //! \param [in] inName : entity name
530  //! \param [in] inCount : Number to add (default = 1)
531  //! \return dtkNoError if OK
532  Dtk_ErrorStatus AddReadingEntity(Dtk_ID inComponentID, const char * inName, int inCount=1);
533 
534  //! \brief Adds to log a synthetic reading inventory and associates it to a component from its ID
535  //! \param [in] inComponentID : Component ID
536  //! \param [in] inNum : Number of entity types
537  //! \param [in] inCount : Array of count of entities (size of array must be inNum)
538  //! \param [in] inEntitiesName : Array of entity names (size of array must be inNum)
539  //! \return dtkNoError if OK
540  Dtk_ErrorStatus AddSyntheticReadingInventory(Dtk_ID inComponentID, int inNum, int *inCount, char **inEntitiesName);
541 
542  //! \brief Adds to log a writing inventory and associates it to an output file from its name
543  //! \param [in] inOutputFileName : Output file name
544  //! \param [in] inNum : Number of entity types
545  //! \param [in] inCount : Array of count of entities (size of array must be inNum)
546  //! \param [in] inEntitiesName : Array of entity names (size of array must be inNum)
547  //! \return dtkNoError if OK
548  Dtk_ErrorStatus AddWritingInventory(const Dtk_string& inOutputFileName, int inNum, int *inCount, char **inEntitiesName);
549 
550  //! \brief Adds to log a synthetic writing inventory and associates it to an output file from its name
551  //! \param [in] inOutputFileName : Output file name
552  //! \param [in] inNum : Number of entity types
553  //! \param [in] inCount : Array of count of entities (size of array must be inNum)
554  //! \param [in] inEntitiesName : Array of entity names (size of array must be inNum)
555  //! \return dtkNoError if OK
556  Dtk_ErrorStatus AddSyntheticWritingInventory(const Dtk_string& inOutputFileName, int inNum, int *inCount, char **inEntitiesName);
557 
558  //! \brief Adds to log the name of a written output file
559  //! \param [in] inOutputFileName : Name of written output file
560  //! \param [in] isRoot : DTK_TRUE if output file is root, DTK_FALSE otherwise
561  //! \return dtkNoError if OK
563 
564  //! \brief Adds to log a warning message
565  //! \param [in] inMessage : Message
566  //! \param [in] inType : Type
567  //! \param [in] inComponentID : -1 if message is global, component ID otherwise
568  //! \return dtkNoError if OK
569  Dtk_ErrorStatus AddWarningMessage(const Dtk_string& inMessage, const Dtk_string& inType, int inComponentID = -1);
570 
571  //! \brief Adds to log an error message
572  //! \param [in] inMessage : Message
573  //! \param [in] inType : Type
574  //! \param [in] inComponentID : -1 if message is global, component ID otherwise
575  //! \return dtkNoError if OK
576  Dtk_ErrorStatus AddErrorMessage(const Dtk_string& inMessage, const Dtk_string& inType, int inComponentID = -1);
577 
578  //! \brief Adds to log an info message
579  //! \param [in] inMessage : Message
580  //! \param [in] inType : Type
581  //! \param [in] inComponentID : -1 if message is global, component ID otherwise
582  //! \return dtkNoError if OK
583  Dtk_ErrorStatus AddInfoMessage(const Dtk_string& inMessage, const Dtk_string& inType, int inComponentID = -1);
584 
585  //! \brief Adds to log the info of a read component and its reading error status
586  //! \param [in] inComponent : Dtk_ComponentPtr pointer to the read component
587  //! \param [in] inStatus : Reading error status (Dtk_ErrorStatus)
588  //! \return dtkNoError if OK
590 
591  //! \brief Adds to log the info of a read file and its reading error status (must only be called if Dtk_ComponentPtr is not used by reading)
592  //! \param [in] inInputFileName : Input file name
593  //! \param [in] inFileVersion : Input file version
594  //! \param [in] inIsAssembly : 1 if root component of the file is an assembly, 0 if it is a part
595  //! \param [in] inUnitScale : Dtk_Double64 in millimeters
596  //! \param [in] inStatus : Reading error status (Dtk_ErrorStatus)
597  //! \return dtkNoError if OK
598  Dtk_ErrorStatus AddFileInfoAndReadingErrorStatus(const Dtk_string& inInputFileName, Dtk_string inFileVersion, Dtk_bool inIsAssembly,
599  Dtk_Double64 inUnitScale, Dtk_ErrorStatus inStatus);
600 
601  //! \brief Add to log the validation property of a component from its ID
602  //! \param [in] inComponentID : Component ID
603  //! \param [in] inEntityID : Entity ID
604  //! \param [in] inEntityType : Entity type
605  //! \param [in] inValPropName : Validation property name
606  //! \param [in] inRead : Read value
607  //! \param [in] inComputed : Computed value
608  //! \param [in] inGap : Gap value
609  //! \param [in] inStatus : Status
610  //! \return dtkNoError if OK
611  Dtk_ErrorStatus AddValidationProperty(Dtk_Size_t inComponentID, const Dtk_string &inEntityID, const Dtk_string &inEntityType,
612  const Dtk_string &inValPropName, const Dtk_string &inRead, const Dtk_string &inComputed,
613  const Dtk_string &inGap, const Dtk_string &inStatus);
614 
615  //! \brief Add to log the validation property of an output file from its name
616  //! \param [in] inOutputFileName : Name of written output file
617  //! \param [in] inEntityID : Entity ID
618  //! \param [in] inEntityType : Entity type
619  //! \param [in] inValPropName : Validation property name
620  //! \param [in] inWrite : Write value
621  //! \return dtkNoError if OK
622  Dtk_ErrorStatus AddOutputFileValidationProperty(const Dtk_string& inOutputFileName, const Dtk_string &inEntityID, const Dtk_string &inEntityType,
623  const Dtk_string &inValPropName, const Dtk_string &inWrite);
624 
625  //! \brief Write the content of the log into the .xml file (SetLogFileName() must be called for that)
626  //! \return dtkNoError if OK
628 
629  //! \brief Flush the content of the log
630  //! \return dtkNoError if OK
632 };
633 
634 
635 
636 
637 #endif
Dtk_Log_Component_Info::GetName
const Dtk_string & GetName() const
Get name of component.
Dtk_Log::SetInputFileVersion
void SetInputFileVersion(const Dtk_string &inVal)
Set input file version.
Dtk_Log::SetStopHour
void SetStopHour(Dtk_string inVal)
Set stop hour.
Dtk_Log_Message
Definition: dtk_log.hpp:55
Dtk_Log::SetInputFormat
void SetInputFormat(const Dtk_string &inVal)
Set input format name.
Dtk_Log::FillConfig
Dtk_ErrorStatus FillConfig()
Fill log with config information (must be called after config initialization)
Dtk_Log_Message::GetType
const Dtk_string & GetType() const
Get message type
Dtk_ID
uint32_t Dtk_ID
Definition: define.h:688
Dtk_Log_Inventory::GetEntityType
const Dtk_string & GetEntityType(Dtk_Size_t inIndex) const
Get entity type in inventory from index.
Dtk_Log::GetOutputFileNamesWritten
const Dtk_tab< Dtk_string > & GetOutputFileNamesWritten() const
Get list of names of written output files.
Dtk_Log_Inventory::Dtk_Log_Inventory
Dtk_Log_Inventory(Dtk_Log_Inventory &&inInventory) DTK_NOEXCEPT
Dtk_Log::AssociateFileNames
Dtk_ErrorStatus AssociateFileNames(const Dtk_string &inTemporaryFile, const Dtk_string &inFileName)
Associates temporary file to another file (used for writing when using temporary file to create anoth...
Dtk_Log
Definition: dtk_log.hpp:177
Dtk_Log::SetCPUTime
void SetCPUTime(double inVal)
Set CPU time.
Dtk_Log::AddReadingEntity
Dtk_ErrorStatus AddReadingEntity(Dtk_ID inComponentID, const char *inName, int inCount=1)
Adds to log a reading inventory and associates it to a component from its ID
Dtk_Log_Component_Info::operator=
Dtk_Log_Component_Info & operator=(const Dtk_Log_Component_Info &inComponentInfo)
Dtk_Log_Component_Info::SetQuantity
void SetQuantity(int val)
Set number of instantiations of component.
Dtk_Log_Message::operator=
Dtk_Log_Message & operator=(Dtk_Log_Message &&inMessage) DTK_NOEXCEPT
Dtk_Log::GetComponentReadingErrorStatus
Dtk_ErrorStatus GetComponentReadingErrorStatus(Dtk_Size_t inComponentID, Dtk_ErrorStatus &outReadingErrorStatus)
Get reading error status of component from component ID.
Dtk_Log_Component_Info::GetFileVersion
const Dtk_string & GetFileVersion() const
Get file version of component
Dtk_UInt64
uint64_t Dtk_UInt64
Definition: define.h:692
Dtk_Log_Component_Info::Dtk_Log_Component_Info
Dtk_Log_Component_Info()
Dtk_Log_Component_Info::SetFullPathName
void SetFullPathName(const Dtk_string &val)
Set full path name of component.
Dtk_Log::SetWorkingSetSize
void SetWorkingSetSize(Dtk_UInt64 inVal)
Set working set size.
Dtk_Log_Component_Info::Dtk_Log_Component_Info
Dtk_Log_Component_Info(const Dtk_Log_Component_Info &inComponentInfo)
Dtk_Log::GetOutputFileName
const Dtk_string & GetOutputFileName() const
Get output file name.
Dtk_Log::GetXslSchemaName
const Dtk_string & GetXslSchemaName() const
Get Xsl schema name used in the .xml log file.
Dtk_Log::GetOutputFileInventory
Dtk_ErrorStatus GetOutputFileInventory(Dtk_string inFileName, Dtk_Log_Inventory &outInventory)
Get inventory of written output file from its name.
Dtk_Log_Message::operator=
Dtk_Log_Message & operator=(const Dtk_Log_Message &inMessage)
Dtk_Log::AddSyntheticReadingInventory
Dtk_ErrorStatus AddSyntheticReadingInventory(Dtk_ID inComponentID, int inNum, int *inCount, char **inEntitiesName)
Adds to log a synthetic reading inventory and associates it to a component from its ID
Dtk_Log::GetLogFileName
const Dtk_string & GetLogFileName() const
Get log file name (with .xml extension)
Dtk_Log_Inventory::Dtk_Log_Inventory
Dtk_Log_Inventory(const Dtk_Log_Inventory &inInventory)
Dtk_Log_Component_Info::GetFileSize
long GetFileSize() const
Get file size of component.
Dtk_Log_Component_Info::GetQuantity
int GetQuantity() const
Get number of instantiations of component
Dtk_Log_Message::~Dtk_Log_Message
~Dtk_Log_Message()
Dtk_Log::SetProductMode
void SetProductMode(const Dtk_string &inVal)
Set product mode.
Dtk_Log::GetStopHour
const Dtk_string & GetStopHour() const
Get stop hour of process
Dtk_Log_Component_Info::SetUnitScale
void SetUnitScale(Dtk_Double64 val)
Set unit scale of component.
Dtk_Log::Flush
virtual Dtk_ErrorStatus Flush()
Flush the content of the log.
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:53
Dtk_Log::SetIsXslEmbedded
void SetIsXslEmbedded(Dtk_bool inVal)
Tells if .xsl must be embedded in the .xml log file.
Dtk_Log::GetNbOutputFileValidationProperties
Dtk_Size_t GetNbOutputFileValidationProperties(const Dtk_string &inOutputFileName)
Get number of validation properties of an output file from its name.
Dtk_Size_t
size_t Dtk_Size_t
Definition: define.h:711
Dtk_Log::GetNbValidationProperties
Dtk_Size_t GetNbValidationProperties(Dtk_Size_t inComponentID)
Get number of validation properties of a component from its ID.
Dtk_Log_Inventory::Dtk_Log_Inventory
Dtk_Log_Inventory()
Dtk_Log::SetUnitScale
void SetUnitScale(double inVal)
Set unit scale.
Dtk_Log::GetStartHour
const Dtk_string & GetStartHour() const
Get start hour of process
Dtk_Log::DtkDynamicCast
static Dtk_Log * DtkDynamicCast(Dtk_Object *inObject)
Dtk_Log::SetIsCrash
void SetIsCrash(Dtk_bool inVal)
Tells if there was a crash or not.
Dtk_Log_Component_Info::GetIsAssembly
Dtk_bool GetIsAssembly() const
Get if component is an assembly or a part
Dtk_Log::AddSyntheticWritingInventory
Dtk_ErrorStatus AddSyntheticWritingInventory(const Dtk_string &inOutputFileName, int inNum, int *inCount, char **inEntitiesName)
Adds to log a synthetic writing inventory and associates it to an output file from its name
Dtk_Log::Create
static Dtk_LogPtr Create()
Calls default constructor to allocate a new object.
Dtk_Log_Component_Info::GetFullPathName
const Dtk_string & GetFullPathName() const
Get full path name of component.
Dtk_Log_Component_Info::operator=
Dtk_Log_Component_Info & operator=(Dtk_Log_Component_Info &&inComponentInfo) DTK_NOEXCEPT
DTK_FALSE
#define DTK_FALSE
Definition: define.h:727
Dtk_bool
char Dtk_bool
Definition: define.h:724
Dtk_Log::GetPeakWorkingSetSize
Dtk_UInt64 GetPeakWorkingSetSize() const
Get peak working set size of process
Dtk_Log::GetHealingFlag
int GetHealingFlag() const
Get healing flag.
Dtk_Double64
double Dtk_Double64
Definition: define.h:698
Dtk_Log_Message::Dtk_Log_Message
Dtk_Log_Message()
Dtk_Log::GetAPIVersion
int GetAPIVersion() const
Get API version.
Dtk_Log_Inventory::GetEntitiesCount
int GetEntitiesCount(Dtk_Size_t inIndex) const
Get count of entities with the same type in inventory from index.
Dtk_Log::_Private
std::unique_ptr< Dtk_Handle > _Private
Definition: dtk_log.hpp:179
Dtk_Log_Component_Info::_Private
std::unique_ptr< Dtk_Handle > _Private
Definition: dtk_log.hpp:88
Dtk_Log_Inventory
Definition: dtk_log.hpp:15
Dtk_Log::~Dtk_Log
virtual ~Dtk_Log()
Dtk_Log::GetComponentInfo
Dtk_ErrorStatus GetComponentInfo(Dtk_Size_t inComponentID, Dtk_Log_Component_Info &outComponentInfo)
Get component information from component ID.
Dtk_Log::GetWorkingSetSize
Dtk_UInt64 GetWorkingSetSize() const
Get working set size of process
Dtk_Log_Component_Info::GetUnitScale
Dtk_Double64 GetUnitScale() const
Get unit scale of component.
Dtk_Log::GetInputFileVersion
const Dtk_string & GetInputFileVersion() const
Get file version of input file
Dtk_Log::GetListComponentID
Dtk_ErrorStatus GetListComponentID(Dtk_tab< Dtk_ID > &outListID)
Get list of ID of read components.
Dtk_Log::SetStartTime
void SetStartTime(time_t inVal)
Set start time.
Dtk_Log_Component_Info::GetIsInternal
Dtk_bool GetIsInternal() const
Get if component is internal
Dtk_Log_Component_Info::SetIsInternal
void SetIsInternal(Dtk_bool val)
Set if component is internal.
Dtk_Log::GetXslFolder
const Dtk_string & GetXslFolder() const
Get Folder that contains .xsl schema file used in .xml log file
Dtk_Log::Write
virtual Dtk_ErrorStatus Write()
Write the content of the log into the .xml file (SetLogFileName() must be called for that)
Dtk_Log_Inventory::GetNbEntityTypes
Dtk_Size_t GetNbEntityTypes() const
Get number of entity types in inventory
Dtk_Log::AddErrorMessage
Dtk_ErrorStatus AddErrorMessage(const Dtk_string &inMessage, const Dtk_string &inType, int inComponentID=-1)
Adds to log an error message.
Dtk_Log::GetGlobalWarningMessages
Dtk_ErrorStatus GetGlobalWarningMessages(Dtk_tab< Dtk_Log_Message > &outMessages)
Get global warning messages.
Dtk_Log::AddReadingInventory
Dtk_ErrorStatus AddReadingInventory(Dtk_ID inComponentID, int inNum, const int *inCount, const char **inEntitiesName)
Adds to log a reading inventory and associates it to a component from its ID
Dtk_Log::GetStartTime
time_t GetStartTime() const
Get start time of process
Dtk_Log::GetComponentWarningMessages
Dtk_ErrorStatus GetComponentWarningMessages(Dtk_Size_t inComponentID, Dtk_tab< Dtk_Log_Message > &outMessages)
Get warning messages associated to a component from its ID.
Dtk_Log_Message::SetMessageInfo
void SetMessageInfo(const Dtk_string &inValue)
Set message.
Dtk_Log::AddFileInfoAndReadingErrorStatus
Dtk_ErrorStatus AddFileInfoAndReadingErrorStatus(const Dtk_string &inInputFileName, Dtk_string inFileVersion, Dtk_bool inIsAssembly, Dtk_Double64 inUnitScale, Dtk_ErrorStatus inStatus)
Adds to log the info of a read file and its reading error status (must only be called if Dtk_Componen...
Dtk_Log_Component_Info::SetIsAssembly
void SetIsAssembly(Dtk_bool val)
Set if component is an assembly or a part.
Dtk_Log_Component_Info
Definition: dtk_log.hpp:86
Dtk_Log::GetOutputFileValidationProperty
Dtk_ErrorStatus GetOutputFileValidationProperty(const Dtk_string &inOutputFileName, Dtk_Size_t inIndex, Dtk_string &outEntityID, Dtk_string &outEntityType, Dtk_string &outValPropName, Dtk_string &outRead, Dtk_string &outComputed, Dtk_string &outGap, Dtk_string &outStatus)
Get validation property of an output file from its name and index.
Dtk_Log::GetConfigSection
Dtk_ErrorStatus GetConfigSection(Dtk_Size_t inIndex, Dtk_string &outName, Dtk_tab< Dtk_string > &outParameters, Dtk_tab< Dtk_string > &outValues)
Get configuration section information (section name, parameters and values) from index.
dtk_maindoc_ptr.hpp
Dtk_Log_Inventory::GetTotalCount
Dtk_Size_t GetTotalCount() const
Get total count of entities in inventory
Dtk_Log_Component_Info::GetIsCatalog
Dtk_bool GetIsCatalog() const
Get if component is a catalog or a not
Dtk_Log::GetOutputFormat
const Dtk_string & GetOutputFormat() const
Get output format name.
Dtk_Log::GetGlobalErrorMessages
Dtk_ErrorStatus GetGlobalErrorMessages(Dtk_tab< Dtk_Log_Message > &outMessages)
Get global error messages.
Dtk_Log::DtkDynamicType
int DtkDynamicType(const int &inId)
downcasting
error_dtk.hpp
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
Dtk_Log::GetWallTime
double GetWallTime() const
Get wall time of process
Dtk_Log::GetComponentInfoMessages
Dtk_ErrorStatus GetComponentInfoMessages(Dtk_Size_t inComponentID, Dtk_tab< Dtk_Log_Message > &outMessages)
Get info messages associated to a component from its ID.
Dtk_Log::AddWritingInventory
Dtk_ErrorStatus AddWritingInventory(const Dtk_string &inOutputFileName, int inNum, int *inCount, char **inEntitiesName)
Adds to log a writing inventory and associates it to an output file from its name
Dtk_Log::SetConfigFileName
void SetConfigFileName(const Dtk_string &inVal)
Set config file name.
Dtk_Log_Component_Info::SetFileSize
void SetFileSize(long val)
Set file size of component.
Dtk_Log_Inventory::operator=
Dtk_Log_Inventory & operator=(Dtk_Log_Inventory &&inInventory) DTK_NOEXCEPT
Dtk_Log_Inventory::_Private
std::unique_ptr< Dtk_Handle > _Private
Definition: dtk_log.hpp:17
Dtk_Log::SetOutputFileName
void SetOutputFileName(const Dtk_string &inVal)
Set output file name.
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
Dtk_Log_Component_Info::Dtk_Log_Component_Info
Dtk_Log_Component_Info(Dtk_Log_Component_Info &&inComponentInfo) DTK_NOEXCEPT
Dtk_Log::SetPeakWorkingSetSize
void SetPeakWorkingSetSize(Dtk_UInt64 inVal)
Set Peak working set size.
Dtk_Log_Component_Info::GetPath
const Dtk_string & GetPath() const
Get path of component.
Dtk_Log::AddOutputFileValidationProperty
Dtk_ErrorStatus AddOutputFileValidationProperty(const Dtk_string &inOutputFileName, const Dtk_string &inEntityID, const Dtk_string &inEntityType, const Dtk_string &inValPropName, const Dtk_string &inWrite)
Add to log the validation property of an output file from its name.
Dtk_Log_Message::Dtk_Log_Message
Dtk_Log_Message(const Dtk_Log_Message &inMessage)
Dtk_Log::GetStopTime
time_t GetStopTime() const
Get stop time of process
Dtk_Log::AddComponentInfoAndReadingErrorStatus
Dtk_ErrorStatus AddComponentInfoAndReadingErrorStatus(const Dtk_ComponentPtr &inComponent, Dtk_ErrorStatus inStatus)
Adds to log the info of a read component and its reading error status.
Dtk_Log::GetComponentSyntheticInventory
Dtk_ErrorStatus GetComponentSyntheticInventory(Dtk_Size_t inComponentID, Dtk_Log_Inventory &outInventory)
Get synthetic inventory of component from its ID.
Dtk_Log_Component_Info::SetFileVersion
void SetFileVersion(const Dtk_string &val)
Set file version of component.
Dtk_Log_Message::SetType
void SetType(const Dtk_string &inValue)
Set message type.
Dtk_Log::GetConfigFileName
const Dtk_string & GetConfigFileName() const
Get config file name.
util_stl_dtk.hpp
Dtk_Log_Message::Dtk_Log_Message
Dtk_Log_Message(Dtk_Log_Message &&inMessage) DTK_NOEXCEPT
Dtk_Log::GetInputFormat
const Dtk_string & GetInputFormat() const
Get input format name.
Dtk_Log::SetHealingFlag
void SetHealingFlag(int inVal)
Set healing flag.
Dtk_Log::GetProductMode
const Dtk_string & GetProductMode() const
Get product mode.
define.h
Dtk_Log_Message::_Private
std::unique_ptr< Dtk_Handle > _Private
Definition: dtk_log.hpp:57
Dtk_Log::GetUnitScale
double GetUnitScale() const
Get unit scale.
Dtk_Log_Component_Info::SetIsCatalog
void SetIsCatalog(Dtk_bool val)
Set if component is a catalog.
Dtk_Log::Dtk_Log
Dtk_Log()
Dtk_Log_Component_Info::SetName
void SetName(const Dtk_string &val)
Set name of component.
Dtk_tab< Dtk_string >
Dtk_Log::GetOutputFileSyntheticInventory
Dtk_ErrorStatus GetOutputFileSyntheticInventory(Dtk_string inFileName, Dtk_Log_Inventory &outInventory)
Get synthetic inventory of written output file from its name.
Dtk_Log::GetNbConfigSections
Dtk_Size_t GetNbConfigSections()
Get number of sections of the configuration
Dtk_Log::AddOutputFileNameWritten
Dtk_ErrorStatus AddOutputFileNameWritten(const Dtk_string &inOutputFileName, Dtk_bool isRoot=DTK_FALSE)
Adds to log the name of a written output file.
Dtk_Log::SetLogFileName
void SetLogFileName(const Dtk_string &inVal)
Set log file name.
Dtk_Log::SetOutputFormat
void SetOutputFormat(const Dtk_string &inVal)
Set output format name.
Dtk_Log::AddValidationProperty
Dtk_ErrorStatus AddValidationProperty(Dtk_Size_t inComponentID, const Dtk_string &inEntityID, const Dtk_string &inEntityType, const Dtk_string &inValPropName, const Dtk_string &inRead, const Dtk_string &inComputed, const Dtk_string &inGap, const Dtk_string &inStatus)
Add to log the validation property of a component from its ID.
Dtk_Log::AddWarningMessage
Dtk_ErrorStatus AddWarningMessage(const Dtk_string &inMessage, const Dtk_string &inType, int inComponentID=-1)
Adds to log a warning message.
Dtk_Object
Definition: dtk_object.hpp:8
Dtk_Log::_typeID
@ _typeID
Definition: dtk_log.hpp:181
Dtk_Log::SetXslFolder
void SetXslFolder(const Dtk_string &inVal)
Set Folder that contains .xsl schema file to use in .xml log file.
dtk_string.hpp
Dtk_Log::GetListMissingComponents
Dtk_tab< Dtk_ID > GetListMissingComponents()
Get List of ID of missing components.
Dtk_Log::GetOutputFileSize
long GetOutputFileSize() const
Get size of output file
Dtk_Log::GetValidationProperty
Dtk_ErrorStatus GetValidationProperty(Dtk_Size_t inComponentID, Dtk_Size_t inIndex, Dtk_string &outEntityID, Dtk_string &outEntityType, Dtk_string &outValPropName, Dtk_string &outRead, Dtk_string &outComputed, Dtk_string &outGap, Dtk_string &outStatus)
Get validation property of a component from its ID and index.
Dtk_Log::GetCPUTime
double GetCPUTime() const
Get CPU time of process
Dtk_Log::SetStopTime
void SetStopTime(time_t inVal)
Set stop time.
DTK_TYPE_LOG
@ DTK_TYPE_LOG
Definition: define.h:587
Dtk_Log_Component_Info::~Dtk_Log_Component_Info
~Dtk_Log_Component_Info()
Dtk_Log::AddInfoMessage
Dtk_ErrorStatus AddInfoMessage(const Dtk_string &inMessage, const Dtk_string &inType, int inComponentID=-1)
Adds to log an info message.
Dtk_Log::GetIsCrash
Dtk_bool GetIsCrash()
Get if there was a crash or not
Dtk_Log::GetComponentErrorMessages
Dtk_ErrorStatus GetComponentErrorMessages(Dtk_Size_t inComponentID, Dtk_tab< Dtk_Log_Message > &outMessages)
Get error messages associated to a component from its ID.
Dtk_Log_Inventory::~Dtk_Log_Inventory
~Dtk_Log_Inventory()
Dtk_LogPtr
Dtk_SmartPtr< Dtk_Log > Dtk_LogPtr
Definition: dtk_log.hpp:11
Dtk_Log::GetGlobalInfoMessages
Dtk_ErrorStatus GetGlobalInfoMessages(Dtk_tab< Dtk_Log_Message > &outMessages)
Get global info messages.
Dtk_Log::GetInputFileName
const Dtk_string & GetInputFileName() const
Get input file name.
Dtk_Log::SetStartHour
void SetStartHour(Dtk_string inVal)
Set start hour.
Dtk_Log_Inventory::operator=
Dtk_Log_Inventory & operator=(const Dtk_Log_Inventory &inInventory)
Dtk_Log::GetXslFilePath
Dtk_string GetXslFilePath() const
Get full file path of the .xsl schema file used in .xml log file
Dtk_Log::GetComponentInventory
Dtk_ErrorStatus GetComponentInventory(Dtk_Size_t inComponentID, Dtk_Log_Inventory &outInventory)
Get inventory of component from its ID.
Dtk_Log_Inventory::AddEntity
void AddEntity(int inCount, const Dtk_string &inName)
Adds entity type and its count to inventory
Dtk_Log_Message::GetMessageInfo
const Dtk_string & GetMessageInfo() const
Get message
dtk_object.hpp
Dtk_Log::SetInputFileName
void SetInputFileName(const Dtk_string &inVal)
Set input file name.
Dtk_Log::SetWallTime
void SetWallTime(double inVal)
Set wall time.
DTK_NOEXCEPT
#define DTK_NOEXCEPT
Definition: config.hpp:20