1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
33
34 import xdc.runtime.ITimestampClient;
35 import xdc.runtime.IGateProvider;
36
37 38 39 40
41
42 /*!
43 * ======== LoggerSysTID ========
44 * A logger which routes events to the system `printf` function with task ids.
45 *
46 * This logger processes log events as they are generated and routes
47 * them through the `{@link System#printf System_printf()}` function.
48 * The final disposition of the log event is dependent on which system
49 * provider has been assigned to the
50 * `{@link System#SupportProxy System.SupportProxy}` configuration parameter.
51 *
52 * Note that the log events are processed within the runtime context
53 * of the `{@link Log Log_write()}` or `{@link Log Log_print()}` function
54 * that generated the event. It is important to account for the processing
55 * overhead and stack usage imposed on the runtime context. The cost of
56 * this processing is defined by the implementation of the system provider.
57 *
58 * Note that the only difference between LoggerSysTID and
59 * xdc.runtime.LoggerSys is the addition of the task id.
60 *
61 * @a(Examples)
62 * Configuration example: The following XDC configuration statements
63 * create a logger instance, assign it as the default logger for all
64 * modules, and enable `USER1` logging in all modules of the package
65 * `my.pkg`. See the `{@link Diags#setMaskMeta Diags.setMaskMeta()}` function
66 * for details on specifying the module names.
67 *
68 * @p(code)
69 * var Defaults = xdc.useModule('xdc.runtime.Defaults');
70 * var Diags = xdc.useModule('xdc.runtime.Diags');
71 * var LoggerSysTID = xdc.useModule('xdc.runtime.LoggerSysTID');
72 *
73 * var LoggerSysTIDParams = new LoggerSysTID.Params();
74 * Defaults.common$.logger = LoggerSysTID.create(LoggerSysTIDParams);
75 * Diags.setMaskMeta("my.pkg.%", Diags.USER1, Diags.RUNTIME_ON);
76 * @p
77 */
78
79 @Gated
80
81 module LoggerSysTID inherits xdc.runtime.ILogger {
82
83 /*!
84 * ======== ITimestampProxy ========
85 * User supplied time-stamp proxy
86 *
87 * This proxy allows `LoggerSys` to use a timestamp server different
88 * from the server used by `{@link xdc.runtime.Timestamp}`. However, if
89 * not supplied by a user, this proxy defaults to whichever timestamp
90 * server is used by `Timestamp`.
91 */
92 proxy TimestampProxy inherits ITimestampClient;
93
94
95 config IGateProvider.Handle gate;
96
97 instance:
98
99 /*!
100 * ======== create ========
101 * Create a `LoggerSysTID` logger
102 *
103 * The logger instance will route all log events it receives to
104 * the {@link System#printf} function.
105 */
106 create();
107
108 internal:
109
110 struct Instance_State {
111 Bool enabled;
112 };
113 }
114 115 116 117
118