fork of Sam Grove's library
Fork of LogUtil by
LogUtil.cpp@1:491d2a7f4207, 2013-03-29 (annotated)
- Committer:
- sam_grove
- Date:
- Fri Mar 29 20:02:18 2013 +0000
- Revision:
- 1:491d2a7f4207
- Parent:
- 0:3054bbdace4c
- Child:
- 3:9f20058284bd
Updated documentation and added exit to error
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sam_grove | 0:3054bbdace4c | 1 | /** |
sam_grove | 0:3054bbdace4c | 2 | * @file LogUtil.cpp |
sam_grove | 0:3054bbdace4c | 3 | * @brief Utility to log messages during runtime |
sam_grove | 0:3054bbdace4c | 4 | * @author sam grove |
sam_grove | 0:3054bbdace4c | 5 | * @version 1.0 |
sam_grove | 1:491d2a7f4207 | 6 | * @see http://www.drdobbs.com/cpp/a-lightweight-logger-for-c/240147505 |
sam_grove | 0:3054bbdace4c | 7 | * |
sam_grove | 0:3054bbdace4c | 8 | * Copyright (c) 2013 |
sam_grove | 0:3054bbdace4c | 9 | * |
sam_grove | 0:3054bbdace4c | 10 | * Licensed under the Apache License, Version 2.0 (the "License"); |
sam_grove | 0:3054bbdace4c | 11 | * you may not use this file except in compliance with the License. |
sam_grove | 0:3054bbdace4c | 12 | * You may obtain a copy of the License at |
sam_grove | 0:3054bbdace4c | 13 | * |
sam_grove | 0:3054bbdace4c | 14 | * http://www.apache.org/licenses/LICENSE-2.0 |
sam_grove | 0:3054bbdace4c | 15 | * |
sam_grove | 0:3054bbdace4c | 16 | * Unless required by applicable law or agreed to in writing, software |
sam_grove | 0:3054bbdace4c | 17 | * distributed under the License is distributed on an "AS IS" BASIS, |
sam_grove | 0:3054bbdace4c | 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
sam_grove | 0:3054bbdace4c | 19 | * See the License for the specific language governing permissions and |
sam_grove | 0:3054bbdace4c | 20 | * limitations under the License. |
sam_grove | 0:3054bbdace4c | 21 | */ |
sam_grove | 0:3054bbdace4c | 22 | |
sam_grove | 0:3054bbdace4c | 23 | #include "LogUtil.h" |
sam_grove | 0:3054bbdace4c | 24 | #include "mbed.h" |
sam_grove | 0:3054bbdace4c | 25 | |
sam_grove | 0:3054bbdace4c | 26 | LogUtil::LogUtil() |
sam_grove | 0:3054bbdace4c | 27 | { |
sam_grove | 0:3054bbdace4c | 28 | Serial debug(USBTX, USBRX); |
sam_grove | 0:3054bbdace4c | 29 | debug.baud(921600); |
sam_grove | 1:491d2a7f4207 | 30 | debug.printf("\033[2J"); // clear the terminal |
sam_grove | 1:491d2a7f4207 | 31 | debug.printf("\033[1;1H");// and set the cursor to home |
sam_grove | 1:491d2a7f4207 | 32 | wait(0.5f); |
sam_grove | 0:3054bbdace4c | 33 | |
sam_grove | 0:3054bbdace4c | 34 | return; |
sam_grove | 0:3054bbdace4c | 35 | } |
sam_grove | 0:3054bbdace4c | 36 | |
sam_grove | 0:3054bbdace4c | 37 |