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