-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* TO REMOVE: Code for development * FIXING COURSES * TO REMOVE TEST SCRIPT * Add logger class * Remove unused course script * Comment out chain verification * Fix seed error if entity count is too low * Comment out seed notif * Comment out notification seed * Remove account request seed * Verify section migration * Fix team migration * Remove previously added column * Fix student migration * Add back updated timestamp * Add more fixes for students * Verified feedback session migration * Remove previously added constraint To be fixed in the main branch instead * Verify feedback questions migration * Verify Feedback response migration * Fix broken seed for feedback questions and response * Remove feedback response updatedAtTimestamp annotation * Verify instructor migration * Fix instructor seed - name * Verify feedback response comment migration * Fix Deadline extension * Remove code used for development * Remove verbose logging for deadline extension --------- Co-authored-by: marquestye <[email protected]>
- Loading branch information
1 parent
8053c27
commit 0798e80
Showing
14 changed files
with
945 additions
and
492 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
668 changes: 450 additions & 218 deletions
668
src/client/java/teammates/client/scripts/sql/DataMigrationForCourseEntitySql.java
Large diffs are not rendered by default.
Oops, something went wrong.
57 changes: 0 additions & 57 deletions
57
src/client/java/teammates/client/scripts/sql/DataMigrationForCourseSql.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package teammates.client.scripts.sql; | ||
|
||
import java.io.OutputStream; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.nio.file.StandardOpenOption; | ||
|
||
import teammates.common.util.Const; | ||
|
||
public class Logger { | ||
private static final String BASE_LOG_URI = "src/client/java/teammates/client/scripts/log/"; | ||
String logPrefix; | ||
|
||
protected Logger(String logPrefix) { | ||
this.logPrefix = logPrefix; | ||
} | ||
|
||
/** | ||
* Returns the prefix for the log line. | ||
*/ | ||
private String getLogPrefix() { | ||
return String.format("%s", logPrefix); | ||
} | ||
|
||
/** | ||
* Logs a line and persists it to the disk. | ||
*/ | ||
public void log(String logLine) { | ||
System.out.println(String.format("%s %s", getLogPrefix(), logLine)); | ||
|
||
Path logPath = Paths.get(BASE_LOG_URI + this.getClass().getSimpleName() + ".log"); | ||
try (OutputStream logFile = Files.newOutputStream(logPath, | ||
StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.APPEND)) { | ||
logFile.write((logLine + System.lineSeparator()).getBytes(Const.ENCODING)); | ||
} catch (Exception e) { | ||
System.err.println("Error writing log line: " + logLine); | ||
System.err.println(e.getMessage()); | ||
} | ||
} | ||
|
||
/** | ||
* Logs an error and persists it to the disk. | ||
*/ | ||
public void logError(String logLine) { | ||
System.err.println(logLine); | ||
|
||
log("[ERROR]" + logLine); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.